Running a Java Service (ie no gui)
Hiya, I'm using the 1.2beta2, and when I run a Java process outside of an X environment, I get the following error: java.lang.reflect.InvocationTargetException: java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:61) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:124) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:63) at java.awt.Font.initializeFont(Font.java:259) at java.awt.Font.(Font.java:289) at javax.swing.plaf.metal.DefaultMetalTheme.(DefaultMetalTheme.java:59) at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(MetalLookAndFeel.java:654) at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:658) at javax.swing.UIManager.setLookAndFeel(UIManager.java:339) at javax.swing.UIManager.setLookAndFeel(UIManager.java:366) at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:820) at javax.swing.UIManager.initialize(UIManager.java:896) at javax.swing.UIManager.maybeInitialize(UIManager.java:913) at javax.swing.UIManager.getUI(UIManager.java:535) at javax.swing.JScrollBar.updateUI(JScrollBar.java:192) at javax.swing.JScrollBar.(JScrollBar.java:143) at javax.swing.JScrollBar.(JScrollBar.java:158) Now I realise this is because Im not running X, and it occurs when I create a JSliderBar (I need to create many components on this backend service, so I cant work around it). Is this a known problem? Cheers, -John -- John Baker, BSc CS. Java developer and Linux lover:-) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Fun with serialization
Hiya, After yesterdays fun with getting a Frame Buffer working (thanks for the advice), Im now having fun with serialization. I am using a Win1.2.2 JVM on the client end, and the rmi server is using the Blackdown1.2.2 or 1.2 (whatever I can get to work:-). When I try to return an object from the server to client, I get the following exception thrown at the client end. java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.InvalidClassException: com.teamenergy.libraries.analysis.TaskImpl; Local class not compatible: stream classdesc serialVersionUID=-813253652674148292 local class serialVersionUID=7569666942426104511 java.io.InvalidClassException: com.teamenergy.libraries.analysis.TaskImpl; Local class not compatible: stream classdesc serialVersionUID=-813253652674148292 local class serialVersionUID=7569666942426104511 at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:438) at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:482) at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:785) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:353) etc Now, both the server and client classes are the same, so, is this because I am using two different jdks? Or does rmi still have a few problems? Cheers, J Baker PS. Frame Buffers rule:-) -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Ref: Subject: Fun with serialization
Oh, sorry to bother you with the Serialization problem. It turned out to be a javac compiled class on the client side, and a jikes compiled class on the server side. I wasn't aware that would cause the class not compatible exception. If only JBuilder would let me use Jikes as the compiler. Evil thing. Cheers, -JmB -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
More fun with serialization:)
Hi again, Back onto serialization. Is the Linux 1.2.2 Jdk compatible with the Windows 1.2.2 Jdk? Although it's easy for me to make sure both Jdks are using the same set of classes I have built, it's a little more difficult when I have to use classes such as: javax.swing.JEditorPane (which it's claiming are different). Cheers, -JmB -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Serialization:)
Do Sun have any plans for long term persistence of objects that have been serialized? The serialization is a lovely idea, but the incompatibility between different Jdk's, and recompiled objects, is a real pain. Oh, thanks for confirming the Linux/Win javax.swing.JEditorPane serial uid for me. -J -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
XML Serialization
Hi, I had a look at the XML Serialization, it does look quite nice, however the docs dont seem to explain how you make a non swing class, or a class that extends swing, serializable via XML. Does anyone know of a magic url that might shed some light on this? Cheers, J Baker -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
JSplitPane
Anyone else find that the mouse "jumps over" the divider in a JSplitPane under the Jdk1.2pre2 and Jdk1.2.2rc2 (aint tried any more) I have the following 'sets' in operation: .setOneTouchExpandable(true); .setContinuousLayout(false); .setDividerSize(8); .setDividerLocation(0.5); -John -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
RMi deaths
Has anyone ever come across this exception: System Error:java.rmi.NoSuchObjectException: no such object in table System Error:at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:249) System Error:at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:224) System Error:at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126) System Error:at com.teamenergy.secure.permissionsserver.GamekeeperRemoteServer_Stub.getActivityPermissions(UnknownSource) I have a small RMI Server which happily runs on a Jdk1.2.2rc2 under Linux. It works fine, but after a while the client gives the above error when it tries to connect. If I just restart the server, it works again. Any ideas? -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: RMi deaths
Erm, yes I read those docs too. The thing is, my RMI objects arent being killed off, and Im not doing anything fancy. It's so simple it might as well be the HelloWorld example;) The Object on the server side just sits there dishing out a "yes" or "no" to attempted logins. On Thu, Dec 02, 1999 at 02:15:15PM -0500, Joseph Shraibman wrote: > [EMAIL PROTECTED] wrote: > > > Has anyone ever come across this exception: > > > > System Error:java.rmi.NoSuchObjectException: no such object in table > > System Error:at >sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:249) > > System Error:at >sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:224) > > System Error:at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126) > > System Error:at >com.teamenergy.secure.permissionsserver.GamekeeperRemoteServer_Stub.getActivityPermissions(UnknownSource) > > > > I have a small RMI Server which happily runs on a Jdk1.2.2rc2 under Linux. > > It works fine, but after a while the client gives the above error when it > > tries to connect. If I just restart the server, it work > > > > >From the javadoc: > > ublic class NoSuchObjectException > extends RemoteException > > A NoSuchObjectException is thrown if an attempt is made to invoke a method on an >object that no longer exists in the remote > virtual machine. If a > NoSuchObjectException occurs attempting to invoke a method on a remote object, the >call may be retransmitted and still > preserve RMI's "at most once" call semantics. A > NoSuchObjectException is also thrown by the method >java.rmi.server.RemoteObject.toStub and by the unexportObject methods of > java.rmi.server.UnicastRemoteObject and java.rmi.activation.Activatable and > > > > ... so perhaps the distributed garbage collection is not working properly? Trying >putting a printline in your finalize > method so you know when your object is garbage collected. -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: RMi deaths
> > System Error:at >sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:249) > > System Error:at >sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:224) > > System Error:at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126) > > System Error:at >com.teamenergy.secure.permissionsserver.GamekeeperRemoteServer_Stub.getActivityPermissions(UnknownSource) > > > > I have a small RMI Server which happily runs on a Jdk1.2.2rc2 under Linux. > > It works fine, but after a while the client gives the above error when it > > tries to connect. If I just restart the server, it works again. > > Is there any period of time during which there is no hard reference to > the GamekeeperRemoteServer object or a stub either in the server, a > registry, or any clients? If so, the object may have been > garbage-collected. No, the GamekeeperRemoteServer is a runnable class (ie it contains the main method). It just sits there doing nothing in particular. Ie it creates an instance of itself, and waits until the client connects. It only dies like this after about 10 minutes of no use. After a client has used the server, does it have to do somethign special to disconnect? -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: RMi deaths
Oh well, problem solved. Thanks for the pointers.
I had in my main method:
GameKeeperRemoteServer server = new GameKeeperRemoteServer();
Naming.rebind("//localhost:" + port + "/GamekeeperRemoteServer",
server);
So it appears that after the main method had completed, after a certain
amount of time, the Gc killed the object, which is odd, because I assumed it
wouldnt as "Naming.rebind" has a reference to it. I simply made the 'server'
variable global and static, and it works fine.
Cheers,
-John
On Thu, Dec 02, 1999 at 03:29:45PM -0800, Nathan Meyers wrote:
> [EMAIL PROTECTED] wrote:
> > No, the GamekeeperRemoteServer is a runnable class (ie it contains the main
> > method). It just sits there doing nothing in particular. Ie it creates an
> > instance of itself, and waits until the client connects. It only dies like
> > this after about 10 minutes of no use. After a client has used the server,
> > does it have to do somethign special to disconnect?
>
> The question is who is holding references to the Remote object. Do you
> publish the server to a registry (with Naming.bind(), for example)? How
> do clients get the RMI stub they need to call the server? If no running
> Java app - local or remote - is holding any live, strong references to
> the object, it has every right to go away. Having a main() method in the
> class doesn't change this (unless you keep a reference to the object in
> main() and make main() immortal).
>
> Have you tried this in other environments? Is this definitely a
> Linux-specific problem you're seeing?
>
> Nathan
>
>
> >
> > > > System Error:at
>sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:249)
> > > > System Error:at
>sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:224)
> > > > System Error:at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> > > > System Error:at
>com.teamenergy.secure.permissionsserver.GamekeeperRemoteServer_Stub.getActivityPermissions(UnknownSource)
> > > >
> > > > I have a small RMI Server which happily runs on a Jdk1.2.2rc2 under Linux.
> > > > It works fine, but after a while the client gives the above error when it
> > > > tries to connect. If I just restart the server, it works again.
> > >
> > > Is there any period of time during which there is no hard reference to
> > > the GamekeeperRemoteServer object or a stub either in the server, a
> > > registry, or any clients? If so, the object may have been
> > > garbage-collected.
> >
> > No, the GamekeeperRemoteServer is a runnable class (ie it contains the main
> > method). It just sits there doing nothing in particular. Ie it creates an
> > instance of itself, and waits until the client connects. It only dies like
> > this after about 10 minutes of no use. After a client has used the server,
> > does it have to do somethign special to disconnect?
--
John Baker, BSc CS.
Java developer and Linux lover:-)
Sms: [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Sun and Inprise Java 2 announcement
I though the current 1.2.2 rc was 3, not 1? Have Sun picked up an older copy to release on their site? On Tue, Dec 07, 1999 at 09:19:28AM -0500, Scott Murray wrote: > Check out: > > http://www.newsalert.com/bin/story?StoryId=CoeYuubWbu0zuvteXmW > > Their J2SE 1.2.2 RC1 is available at: > > http://developer.java.sun.com/developer/earlyAccess/j2sdk122/ > > and here's their "System Requirements": > > This version of the Java 2 SDK is supported on Intel Pentium platform > running the Linux kernel v 2.2.5 and GLibC v 2.1, 32 megabytes RAM > minimum. Recommended 48 megabytes of RAM, 16-bit color mode, KDE and > KWM window managers. > > You should have 65 megabytes of free disk space before attempting to > install the Java 2 SDK software. If you also install the separate > documentation download bundle, you need an additional 90 megabytes of > free disk space. > > We do not support or recommend running Java 2 SDK on SMP kernels. Also > the only thread model supported is green threads. > > I'm praying that the Blackdown team continues it's work if this is what Sun > consider a useful release. I'm really curious as to why the hell Sun and > Inprise went off on their own when the Blackdown port is available... > > Scott > > > -- > = > Scott Murray email: [EMAIL PROTECTED] > http://www.interlog.com/~scottm ICQ: 10602428 > - > "Good, bad ... I'm the guy with the gun." - Ash, "Army of Darkness" > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Slowly compiling java app.
Use Jikes, from IBM. http://www10.software.ibm.com/developerworks/opensource/jikes/?aw=50 On Thu, Dec 16, 1999 at 03:30:45PM +0700, Siriphen Wikaisuksakul wrote: > > When I compile java application, it take very long time to succeed and if I don't >type -J-mx option, it can't compile the application. Here is the error message: > > The compiler has run out of memory. Consider using the "-J-mx" command line >option to increase the maximum heap size. > > Could anyone please suggest the best method to solve my problem? > > ps: My machine is Redhat 6.1 and jdk1.2pre-v2. > > Regards, > Penn. -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Jdk1.3
Hiya! Is it possible to 'backport' the Swing fixes in the 1.3rc1 to the Blackdown Jdk1.2.2? J Baker -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
TYA
Hiya, In reference to the TYA JIT, how does it slot in to the Blackdown Jdk1.2? Has anyone done any benchmarks of the Blackdown JVM performance without a JIT, with it's own JIT and with the TYA JIT? J Baker -- John Baker, BSc CS. Java developer and Linux lover:-) Sms: [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
