 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- prohibited methodwhat does it mean when we say ,
in EJB session bean
"The bean instance calls a prohibited method of its session context."
what does it mean by prohibited method ? who prohibits ? how can we
set this prohibition ?
thanks
- 4
- Best tool/methodology/practise for Java code protection ?I'm writing a commercial engineering library and I am very uneasy about
the apparent ease with which Java binaries are reverse engineered.
I would like to hear from anyone who uses a tool (commercial or
otherwise) for protecting their IP (in the form of source code) when
they distribute their binaries. For obvious reasons, I am not interested
in hearing from any vendor (or employee thereof) who will naturally be
biased in favour of their offering. I will be most interested in hearing
from people who have actually deployed binaries out there in the field,
and are happy with their obfusucation/encryption tool, methodology or
policies etc.
MTIA
- 9
- platform default charsetHello,
How can I change the platform's default charset used by a VM ?
I am talking about the charset used by String methods such
byte[] getBytes()
Encodes this String into a sequence of bytes using the
platform's default charset, storing the result into a new byte array.
Thank you,
Christophe
- 9
- JMS memory footprint sizeAnyone know what the memory footprint of JMS is?. I am trying to work
out if it is too "heavyweight" for use in a thin client.
tkx
- 9
- Transmitting strings via tcp from a windows c++ client to a Java serverHi all,
We have a C++ client which runs on Windows and that needs to transmit
char* / wchar* strings to and from a Java server.
The client should correctly handle both 'standard' languages & east
Asian
languages (i.e. using wchar).
Now, I'm sure there is a best practice for doing so , I just haven't
found it yet :-)
My best bet would be always encoding the string in UTF-8 before
sending
it via the net, but I could be wrong.
Your help will be highly appreciated.
Thanks,
Gilad
- 10
- Using JComponent.getGraphics() in Swing for incremental paintingHello,
I have read many posts and articles saying "don't ever use
getGraphics() in Swing JComponents... always use paintComponent()!" I
understand the motivation for such statements: the paintComponent()
method should be used to implement painting, in order to ensure
correct behavior in all situations.
However, my question is: is it OK, from within an event handler, to
paint using getGraphics() PURELY AS AN OPTIMIZATION, AS LONG AS
paintComponent() does the right thing?
An example:
class MyComponent extends JComponent
{
ArrayList thingsToPaint=new ArrayList();
public void mySwingEventHandler(SomeEvent e)
{
//update thingsToPaint so that paintComponent
//works correctly
thingsToPaint.add(somethingNewToPaint);
//try painting directly
Graphics g = getGraphics();
if(g != null)
{
//we have a graphics, so paint the new
//thing directly.
somethingNewToPaint.drawOn(g);
g.dispose();
}
else
{
//No graphics object available... so just
//call repaint().
repaint();
}
}
public void paintComponent(Graphics g)
{
//paint everything
int i, size = thingsToPaint.size();
for(i=0; i < size; ++i)
{
((ThingToPaint) thingsToPaint.get(i)).drawOn(g);
}
}
};
I actually have a good reason for doing this. I am writing a simple
image manipulation program, and I need to implement a rectanglar
selection facility. In order to accomplish this, I need to listen to
mouseDragged events and repaint the rectangle on the image at each new
position. Swing forces you to re-paint the entire image each time
(i.e. no incremental updates), which is annoyingly slow for this
particular problem. And I don't want to turn off double buffering.
If I use getGraphics() directly (as in the example above), I can just
update a tiny section of the image, and it is blindingly fast and
smooth. I have tested this, and it works wonderfully in my limited
tests. But I don't want to do it if it will be problematic down the
line.
So, is it OK to use getGraphics() if the full repainting functionality
is available in paintComponent()? Or is there some other reason not to
use getGraphics()?
Thanks,
Mike Carrato
- 10
- Ease of Development in Enterprise JavaBeans TechnologyEnterprise JavaBeans (EJB) technology is a J2EE technology for developing
business components in a component-based, enterprise Java application. There's
a new article available that addresses an overview of EJB technology
and information on developing an Enterprise Bean with EJB.
Read about it here:
http://java.sun.com/developer/technicalArticles/ebeans/ejbease/index.html?ssobm=ng
- 10
- have troulbe when learn java tutorial's network socket partHi everyone:
Try fewest word: from Java Turotial->Custom Networking->All About
Sockets->Reading from and Writing to a socket, the following program:
import java.io.*;
import java.net.*;
public class EchoClient {
public static void main(String[] args) throws IOException {
Socket echoSocket = null;
PrintWriter out = null;
BufferedReader in = null;
try {
echoSocket = new Socket("taranis", 7);
out = new PrintWriter(echoSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(
echoSocket.getInputStream()));
} catch (UnknownHostException e) {
System.err.println("Don't know about host: taranis.");
System.exit(1);
} catch (IOException e) {
System.err.println("Couldn't get I/O for "
+ "the connection to: taranis.");
System.exit(1);
}
BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
String userInput;
while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);
System.out.println("echo: " + in.readLine());
}
out.close();
in.close();
stdIn.close();
echoSocket.close();
}
}
But it says "Don't know about host: taranis". If I change it to my
computer's name, it says "Couldn't get I/O for the connection to:
taranis.";
So how can I open echo service on a computer? Thanks.
- 14
- Also, about JColorChooserIs it possible to edit which colors are available in a JColorChooser or
is it simpler to build my own popup window with color selections?
- 14
- A grammar lesson for EdEd wrote:
> Yes, I do! The fact that I got the 5-start ratings on my postings
> explaining how you was rude to me, makes me to kind of trust the
> google ratings!
(To readers of m.e.l.e: this is a perfect example of how NOT to write
English.)
(P.S. I know I shouldn't do this, but it is just too fun to pass up ;-))
Several comments to explain about why this is not proper grammar:
In English, the word `was' indicates the past participle of `to be' in
the third person singular form /only/. The relevant past participle
(here, we need to be in second person, which corresponds as well to all
plural forms) that you are looking for is `were'.
The construction `to make one' is not followed by the word `to'; what
you need to do is drop that word from the following infinitive.
There is no word called `google' (there is a `googol', as in 10^100). If
you are referring to the company with that name, then your
capitalization should reflect that, as a proper noun [*]: `Google'.
Semantically, that classifies all of your sins; however, your choice of
words is not the most appealing in the world.
`To get' is very slangy, and, seeing as Usenet expects a certain level,
of professionalism, the better verb is `to receive'.
I know of no rating that uses `starts'; are you looking for `star'?
`5' should not be written as a digit (as well as other numbers less than
ten), it is better to use `five' in this case.
On forums, the term `posting' should be eschewed in favor of the word
`post' (shorter noun, and I dislike gerunds as well).
Finally, usage of exclamation points is highly disregarded in Usenet
posts, as it places others' impressions of you as roughly equivalent to
a loud-mouthed twelve-year old kid. Your continual usage of vulgar
language and poor grasps on the basic points of politeness also add to
the impression of a brat.
[*] Well, in recent times, companies have fallen in love with the
non-traditional forms of capitalization, preferring such proper nouns as
`iPod'. The best rule of thumb to follow is to use the official
capitalization rules of the company owning the trademark.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
- 14
- Unchecked call hashmapWhat is this with javac -Xlint??
warning: [unchecked] unchecked call to put(K,V) as a memb
er of the raw type java.util.HashMap
headers.put(key,val);
^
- 15
- JTextArea size limitiing question ...I'm using a JTextArea within a JScrollPane within a JViewPort. I am
using the JTextArea to mimic a HyperTerminal like terminal emulation
interface. When I set up the JTextArea I specify the viewable rows and
columns, but since it is inside the JScrollPane it obviously can grow
"infinitely" large (and eventually throw a heap memory exception). My
desire is to not allow this, but was hoping that there was something
within Java itself to passively limit the size of the JTextArea.
Currently I use it to receive diagnostics (through a serial
communications port) from an embedded device, so during testing I could
conceivably let this run for several days (which will most certainly
induce a heap memory exception). I am also logging all of the
diagnostics to a file so I have no need for the JTextArea to grow
"infinitely" large.
So is there a way to passively limit the ultimate size of a JTextArea
that I am missing or do I have to actively determine its size and trim
it down some how (and if so, any suggestion on how to delete "old" data
in a JTextArea)?
Thanks, in advance, for any help.
- 15
- JTable cell editor update several columnsI have a JTable with multiple columns line
let's say : name, cat, subcat, lang
I would like a cell editor on name ;cat , subcat and lang read only
when I edit name whenever I choose a mame that belongs to
cat,subcat,lang the cat,subcat,lang cells are updated .....
tanks a lot
patrick
jdk1.6.0_02/linux
- 16
- Running a bat file from a Tomcat servlet using the exec commandI cannot get a Tomcat servlet to execute a Windows Bat file.
Is there a particular setting in the catalina.policy file that I need
to change?
Here is a code snippet of the call:
Runtime load = Runtime.getRuntime();
Process process = load.exec("cmd.exe /c start copyFiles.bat", null,
new File("C:\\Tomcat 5.0\\webapps\\myApp\\files"));
Thanks for any help.
-Chris
- 16
- java/61407: jdk14 port aborts making html32dtd
>Number: 61407
>Category: java
>Synopsis: jdk14 port aborts making html32dtd
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-java
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 15 21:20:03 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Alan Batie
>Release: FreeBSD 4.8-STABLE i386
>Organization:
RainDrop Laboratories
>Environment:
System: FreeBSD pyrex.batie.org 4.8-STABLE FreeBSD 4.8-STABLE #1: Sun Nov 9 03:18:36 PST 2003 email***@***.com:/usr/src/freebsd/src/sys/compile/PYREX i386
Latest jdk14 port using patchset 6:
# $FreeBSD: ports/java/jdk14/Makefile,v 1.71 2004/01/14 21:21:52 glewis Exp $
>Description:
>How-To-Repeat:
cvsup (this morning about 5:30 or so PST)
cvs update ports
cd ports/java/jdk14
make
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
>>>Recursively making html32dtd html32dtd @ Thu Jan 15 20:56:04 PST 2004 ...
gmake[4]: Entering directory `/usr/src/ports/java/jdk14/work/j2se/make/javax/swing/html32dtd'
gmake make-html32dtd
gmake[5]: Entering directory `/usr/src/ports/java/jdk14/work/j2se/make/javax/swing/html32dtd'
/bin/mkdir -p /usr/src/ports/java/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/obj
/bin/mkdir -p /usr/src/ports/java/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/dtdgenclasses
rm -f /usr/src/ports/java/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/.classes.list
if [ -s /usr/src/ports/java/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/.classes.list ] ; \
then /usr/src/ports/java/jdk14/work/control/build/bsd-i586/bin/javac -J-XX:ThreadStackSize=768 -J-Xms64m -J-Xmx256m -J-Xmaxf1 -classpath /usr/src/ports/java/jdk14/work/control/build/bsd-i586/classes -bootclasspath "/usr/src/ports/java/jdk14/work/control /build/bsd-i586/lib/jce.jar:/usr/src/ports/java/jdk14/work/control/build/bsd-i586/lib/jsse.jar" -sourcepath "/usr/src/ports/java/jdk14/work/control/build/bsd-i586/gensrc:../../../../src/solaris/classes:../../../../src/share/classes" -d /usr/src/ports/jav a/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/dtdgenclasses -source 1.4 \
../../../tools/dtdbuilder/PublicMapping.java ../../../tools/dtdbuilder/DTDParser.java ../../../tools/dtdbuilder/DTDInputStream.java ../../../tools/dtdbuilder/DTDBuilder.java ; \
fi
rm -f /usr/src/ports/java/jdk14/work/control/build/bsd-i586/classes/javax/swing/text/html/parser/html32.bdtd
(/usr/src/ports/java/jdk14/work/control/build/bsd-i586/bin/java -ms16m -mx64m \
-classpath "/usr/src/ports/java/jdk14/work/control/build/bsd-i586/tmp/javax/swing/html/dtbuilder/dtdgenclasses:" \
-Ddtd_home=../../../tools/dtdbuilder/dtds \
dtdbuilder.DTDBuilder html32 > /usr/src/ports/java/jdk14/work/control/build/bsd-i586/classes/javax/swing/text/html/parser/html32.bdtd) || exit 1
[Parsed DTD html32 in 197ms]
Abort trap (core dumped)
gmake[5]: *** [/usr/src/ports/java/jdk14/work/control/build/bsd-i586/classes/javax/swing/text/html/parser/html32.bdtd] Error 1
gmake[5]: Leaving directory `/usr/src/ports/java/jdk14/work/j2se/make/javax/swing/html32dtd'
gmake[4]: *** [swing-html32dtd] Error 2
gmake[4]: Leaving directory `/usr/src/ports/java/jdk14/work/j2se/make/javax/swing/html32dtd'
gmake[3]: *** [html32dtd] Error 1
gmake[3]: Leaving directory `/usr/src/ports/java/jdk14/work/j2se/make/javax/swing'
gmake[2]: *** [all] Error 1
gmake[2]: Leaving directory `/usr/src/ports/java/jdk14/work/j2se/make/javax'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/usr/src/ports/java/jdk14/work/j2se/make'
gmake: *** [j2se-build] Error 2
*** Error code 2
Stop in /usr/src/ports/java/jdk14.
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| Author |
Message |
knightowl

|
Posted: 2005-3-5 21:55:00 |
Top |
java-programmer, Weird Static Issue
Please take a look at the following code section. In this module the
static "qt" becomes null when the constuctor is fired, very similar
code works find in other places in my program. I don't think the
QueryTools class is a problem because I can use the code elsewhere.
public class Authorization
{
static public String TABLE ="authorization";
static private String POOL_NAME = "mysql-invoice-system";
static private QueryTools qt;
static
{
System.out.println("Static Section " + POOL_NAME);
QueryTools qt = new QueryTools(POOL_NAME);
System.out.println(qt);
System.out.println("Static Section End " + POOL_NAME);
}
public Authorization()
{
System.out.println("Authorization Constructor");
System.out.println("QT=" + qt);
}
Here is the output from Netbeans:
run:
Static Section mysql-invoice-system
com.ciorent.HFCConnectionPool.QueryTools@18e2b22
Static Section End mysql-invoice-system
Authorization Constructor
QT=null
Here is the calling code:
Authorization a = new Authorization();
try
{
a.createAccount("email***@***.com", "test4200", 10000);
}
catch (Exception e)
{
System.out.println(e);
}
System.exit(1);
I am going to bet this is something simple that I am missing, hopefully
someone will be able to point out my error.
Thanks
HFC
|
| |
|
| |
 |
knightowl

|
Posted: 2005-3-5 22:03:00 |
Top |
java-programmer >> Weird Static Issue
Well, well,
The very same minute I hit post, I saw the error,
static
{
QueryTools qt = new QueryTools();
}
Should be
static
{
qt = new QueryTools();
}
|
| |
|
| |
 |
Thomas G. Marshall

|
Posted: 2005-3-6 4:36:00 |
Top |
java-programmer >> Weird Static Issue
knightowl coughed up:
> Well, well,
>
> The very same minute I hit post, I saw the error,
>
> static
> {
> QueryTools qt = new QueryTools();
> }
>
> Should be
>
> static
> {
> qt = new QueryTools();
> }
It can be very hard to see things like this.
When I've been hit with an bug that I just cannot figure out, I always go
for the mistaken assumption errors. The kind of errors you just hit on.
One of the ways I've discovered actually helps give your code a "new look"
so that you can read it in a fresh light is to, get this, drum roll please,
actually change the font used by your IDE. And if you can shift the
formatting over from newline-bracket to K&R-bracket (or vice versa) it can
help even more.
It's as if there is a pattern recognition circuit that grabs a glimpse of
code its seen over and over, and then feeds to the brain that it is
something that "works". Having it /look/ different forces you to reparse it
again.
YMMV a lot.
--
"So I just, uh... I just cut them up like regular chickens?"
"Sure, just cut them up like regular chickens."
|
| |
|
| |
 |
Kevin McMurtrie

|
Posted: 2005-3-6 11:27:00 |
Top |
java-programmer >> Weird Static Issue
In article <email***@***.com>,
"knightowl" <email***@***.com> wrote:
> Well, well,
>
> The very same minute I hit post, I saw the error,
>
> static
> {
> QueryTools qt = new QueryTools();
> }
>
> Should be
>
> static
> {
> qt = new QueryTools();
> }
Your IDE might be able to warn you about hiding variables from an outer
scope. I find it very valuable in catching stupid yet stealthy mistakes
like that.
|
| |
|
| |
 |
John C. Bollinger

|
Posted: 2005-3-7 22:10:00 |
Top |
java-programmer >> Weird Static Issue
knightowl wrote:
> Well, well,
>
> The very same minute I hit post, I saw the error,
>
> static
> {
> QueryTools qt = new QueryTools();
> }
>
> Should be
>
> static
> {
> qt = new QueryTools();
> }
>
It may or may not be relevant to your particular case, but I am more and
more recognizing the value of making class and instance variables
"final" when I don't foresee need for them to be changeable. The
finality can always be removed later, if necessary. With final members
there are more avenues for optimization in JIT, but more importantly,
the compiler (and IDE if you use one) can recognize many problems. In
your particular case, it would have told you that the variable qt was
not initialized.
--
John Bollinger
email***@***.com
|
| |
|
| |
 |
Thomas G. Marshall

|
Posted: 2005-3-7 22:56:00 |
Top |
java-programmer >> Weird Static Issue
John C. Bollinger coughed up:
> knightowl wrote:
>
>> Well, well,
>>
>> The very same minute I hit post, I saw the error,
>>
>> static
>> {
>> QueryTools qt = new QueryTools();
>> }
>>
>> Should be
>>
>> static
>> {
>> qt = new QueryTools();
>> }
>>
>
> It may or may not be relevant to your particular case, but I am more
> and more recognizing the value of making class and instance variables
> "final" when I don't foresee need for them to be changeable. The
> finality can always be removed later, if necessary. With final
> members there are more avenues for optimization in JIT, but more
> importantly, the compiler (and IDE if you use one) can recognize many
> problems. In your particular case, it would have told you that the
> variable qt was not initialized.
That is not a terrible idea, and one that many support, *however* I have
personal trouble with adopting this MO only because of the clutter that
appears with all them "finals" showing up in declarations.
--
Onedoctortoanother:"Ifthisismyrectalthermometer,wherethehell'smypen???"
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- JLint port
--=-hJb57ejBSXdHWUZd6IhV
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi there,
I've been looking at the JLint port (java/jlint). This port is flagged
as BROKEN in FreeBSD 5.x. Looking at the JLint homepage I see that
version 3.0 is current (the port is 2.3). I have easily managed to
compile and install JLint 3.0, only a minimal patch is required (to
disable the bool->int mapping in types.hh). Would someone mind upgrading
this port? I send an upgraded port with this email. Please have a look
at it, comment it and check it in if you like.
Best regards, Roman
--=-hJb57ejBSXdHWUZd6IhV
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
--=-hJb57ejBSXdHWUZd6IhV--
- 2
- Efficient polling of a flatfileJust looking for feedback on what you might consider the most efficient
means to poll a flat file.
I need to have my app look at a flat file, say, every second or so, and read
any data that may have been appended to it.
Wondering what others might consider an efficient means of doing this in
Java. Would it be wise to merely look at the file size everysecond or so,
and, if that has changed, to then read it, starting from that byte which was
the previous size of the file on the previous polling a second ago?
Is there a more efficent way to do this? Thanks, Ike
- 3
- Designation standard output as File type I have a method (fragment below) that takes a File type "outFile"
as the output file. However, if the user of this method specifies
"null" for that parameter, I want to make the output go to standard
output instead of a file.
My question: To what do I set outFile (File type) to make the
output go to standard output (display)? System.out is of a type
PrintStream.
Thanks, Alan
public static void printData(File dir, File outFile)
{
try
{
if (outFile == null)
{
outFile = ?????; // Default is standard output (System.out)
}
. . .
- 4
- 5
- setFont() on solarisHi,
In one of my methods, I have a call like:
label.setFont(new Font("Arial", Font.PLAIN, 9));
This call works fine on windows but not on solaris. Moreover, the
label's text gets truncated when it shows up ("Applications" shows as
"Applicati") I iterated through the fonts via
GraphicsEnvironment.getAllFonts() and Arial seems to be available to
the java graphics environment on solaris.
How do I get arial font on solaris and not cause the truncation? Any
suggestions?
Thanks.
- 6
- 7
- JDBC Thin driver for Oracle doesnt loadI'm using Oracle's JDeveloper 10g so the driver should exist. however this
code raises the ClassNotFoundException. so my questions
1. Whats the simplest way to tell if the thin driver for oracle ( or any
other JDBC driver ) exists?
2. If it does not exist where can I download it and where should I put it?
3. If it exists then why doesn't this code run? I've even tried to register
with the DriverManager but the same error.
thx.
import java.sql.*;
public class JDBCThin
{
public static void main(String[] args)
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch ( ClassNotFoundException e )
{
System.out.println(e.getMessage()) ;
}
}
}
- 8
- Xdoclet JBossHi all,
I am new to xdoclet and would like to convert my existing EJB source
files to xdoclet embedded tags and ultimately generating deploy
descriptors for JBoss.(4.0)
My current application server is Pramati and i am migrating to
JBoss(4.04GA) using xdoclet(1.2.3) as the EJB (Spec 2.0) deployment
automation tool. I have the ejb.jar and other descriptors which are
specific to Pramati Application server. I would like to generate the
appropriate interfaces (Remote, Home etc) and JBoss specific
descriptors for each EJB. I goggled but didnt find a complete example
using xdoclet. The information seems to be scattered.
I would like to know the steps for the following ( For eg I have a
MyXYZBean.java )
1) Adding appropriate xdoclet tags(Jboss specific) to this source file
(MyXYZBean.java)
2) Steps to generate the Remote, home etc interface source files ( Eg
MyXYZRemote.java, MyXYZHome.java etc)
3) Steps to generate JBoss specific descriptors (jboss.xml, ejb.jar
etc)
4) A task to be included in my build.xml which takes care of steps 1) ,
2) and 3) appropriately.
Many thanks,
Santosh
- 9
- 10
- .ear files in Sun Java StudioHi all,
I am not sure if this is the right newsgroup for this question. But I just
thought that some of you may be able to help me out; that's why I am asking
you all this question.
I have a .ear file and I just downloaded Sun Java Studio Enterprise 8. May
I ask how can I import this .ear file in Sun Java Studio Enterprise 8? Can
someone point me to the right direction?
Thanks in advance,
Monte
--
---------------------------------------------
"Whatever my lot, thou has taught me to say, 'it is well; it is well with my
soul.'" -- Lyrics of It is well, it is well with my soul.
- 11
- newbie Threads and JDialog Hello all
I've been working with Java for one year and I'm a newbie with
threads, I have the following problem which I suppose you experts can
help:
I have a JDialog extension which I create some JTabbedPane with
some tables. This JDialog and these tables, send data to other class
which performs some calculation. Now I have a problem and I suspect
that its related with threads.
The button actionPerformed listener call a JDialog method that send
data and also "tells" the table to send its data to the calculation
class. After the table send the data, the constructor of the external
calculation programm fails. I'm listing in a reduced way my code:
In the Main (just the part related with the JDialog)
// in the declaratins:
public InputsIntegrationDialog inputIntDiag;
.
.
.
if (operationIndex == INTEGRATION){
if(inputIntDiag == null){
inputIntDiag = new InputsIntegrationDialog(this, getGraph());
}
else
inputIntDiag.setVisible(true);
The InputsIntegrationDialog class resumed:
public class InputsIntegrationDialog extends JDialog implements
ActionListener{
public InputsIntegrationDialog(Window owner, VRGraph grap1) {
super();
this.tabbedPane = new JTabbedPane();
fixedCostsTable = new IntegrationTable();
variableCostsTable = new IntegrationTable();
variableCosts = makeTextPanel(res.getString("variableCosts"));
tabbedPane.addTab("variableCosts",variableCostsTable );
Box okCancel = Box.createHorizontalBox();
ok = new JButton(res.getString("Ok"));
ok.addActionListener(this);
runBut = new JButton(res.getString("Run"));
runBut.addActionListener(this);
. ..// box layouts etc...
Container contentPane = getContentPane();
contentPane.add(tabbedPane, BorderLayout.CENTER);
contentPane.add(vertBox, BorderLayout.PAGE_END);
this.pack();
this.setVisible(true);
}
public void runOPT(){
// initialize the calculation class (hiden)
//send the data from the tables to the calculation
variableCostsTable.sendDataToOpt(data 1, data 2);
// in the line bellow the problem happens!!!!!!!!!!
solver1.setNLP(nlp1.getNLP());
}
public void actionPerformed(ActionEvent e){
System.out.println("Action: " + e.getActionCommand().toString() );
if(e.getActionCommand().toString() == "Ok"){
this.setVisible(false);
}
else if(e.getActionCommand().toString() == "Run"){
// This Line calls runOpt() and inside runOPt the crashes happen
int res = this.runOpt();
if( res1 >= 0){
JOptionPane.showMessageDialog(this,
"Optimization sucessful","Message");
}
else
JOptionPane.showMessageDialog(this,
"Optimization NOT sucessful","Error");
this.setVisible(false);
}
}
}
- 12
- Can't read JAAS config from JARWe have an application that uses JAAS for security.
Until now the JAAS config file was in a folder (conf/) and the
application just ran fine.
To prepare for the deployment of the application with Webstart I packed
the folder with the config file in the application's JAR. Now JAAS
can't seem to find the file anymore.
Working:
|--application.jar
|--conf/
|--auth.conf
Failing:
|--application.jar
|--conf/
|--auth.conf
Both have the same manifest:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
Main-Class: com.fpc.nokeos.core.client.launch.Launcher
Class-Path: . conf
I also tried expliciitely adding "conf/auth.conf" to manifest but it
didn't work either.
The stacktrace I get is
08:57:42,250 - ERROR: [NokeosClientSecurity] Could not connect to the
server.
Please check your network connection.
java.lang.SecurityException: conf/auth.conf (No such file or directory)
at
com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
javax.security.auth.login.Configuration$3.run(Configuration.java:216)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.Configuration.getConfiguration(Configuration.java:210)
at
javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext.init(LoginContext.java:234)
at
javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)
at
com.fpc.nokeos.core.client.security.NokeosClientSecurity.login(NokeosClientSecurity.java:46)
at
com.fpc.nokeos.core.client.launch.Launcher.checkLogin(Launcher.java:89)
at
com.fpc.nokeos.core.client.launch.Launcher.main(Launcher.java:66)
Caused by: java.io.IOException: conf/auth.conf (No such file or
directory)
at
com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:157)
at
com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:95)
... 16 more
How can I make it work?
- 13
- Freelance programmer / developerHello,
I am software developer looking for freelance or Full Time work, do you
have any work that need to done.. buzz me at johnleox @ gmail.com
my skill sets:
VB,
ASP (VBScript & Javascript),
SQL Server,
Access (VBA),
Excel (VBA),
.NET(ASP.NET / C#)
Oracle &
Crystal Reports
I can work on migration projects, supporting exsisting project and
looking out for new project.
If location or place of work is not important for you then buzz..
waiting for your work.
johnleox @ gmail.com
- 14
- Jmatlink help pleasei can use jmatlink to open matlab but I can't
get it to open an m files and therefore run a functions using thev
arrays. How do I get
it to open a certain m file, I have tried to set the path in matlab
but that doesn't work.
Please help.
--
Message posted via http://www.javakb.com
- 15
- Get IP tomcat serverHi !
I am using Tomcat and i would like to get the host IP from the
servletContext object. Does anybody know how to get it ?
Thank you for your help
Best regards
Sylvain Caillet
|
|
|