Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19039 > unrolled thread
| Started by | Clayton Cramer <claytoncramer@gmail.com> |
|---|---|
| First post | 2012-10-02 09:16 -0700 |
| Last post | 2012-10-03 01:33 +0200 |
| Articles | 9 — 6 participants |
Back to article view | Back to comp.lang.java.programmer
Java RMI questions and MyEclipse Clayton Cramer <claytoncramer@gmail.com> - 2012-10-02 09:16 -0700
Re: Java RMI questions and MyEclipse Arne Vajhøj <arne@vajhoej.dk> - 2012-10-02 12:50 -0400
Re: Java RMI questions and MyEclipse Clayton Cramer <claytoncramer@gmail.com> - 2012-10-15 15:03 -0700
Re: Java RMI questions and MyEclipse Lew <lewbloch@gmail.com> - 2012-10-15 15:54 -0700
Re: Java RMI questions and MyEclipse Jeff Higgins <jeff@invalid.invalid> - 2012-10-16 03:20 -0400
Re: Java RMI questions and MyEclipse Jeff Higgins <jeff@invalid.invalid> - 2012-10-16 11:13 -0400
Re: Java RMI questions and MyEclipse Roedy Green <see_website@mindprod.com.invalid> - 2012-10-02 12:58 -0700
Re: Java RMI questions and MyEclipse Arne Vajhøj <arne@vajhoej.dk> - 2012-10-02 16:23 -0400
Re: Java RMI questions and MyEclipse Joerg Meier <joergmmeier@arcor.de> - 2012-10-03 01:33 +0200
| From | Clayton Cramer <claytoncramer@gmail.com> |
|---|---|
| Date | 2012-10-02 09:16 -0700 |
| Subject | Java RMI questions and MyEclipse |
| Message-ID | <3027b606-f909-46df-971f-a13187d9907c@googlegroups.com> |
I hope that I am asking this in the right group. 1. I am looking at the possibility of replacing our browser-based JSP/Struts client talking to Java server classes with a thick client written in Java. (Yes, for most enterprise systems, this would not be a great idea, but for us it does make sense: we have a few hundred PCs talking to our servers; there are never one time users connecting to our servers unless it's a security breach.) 2. I I started with the Oracle demo where the client makes a request for the value of pi to an arbitrary number of places, and the server computes it and passes it back to the client. I was able to get this working using javac and jar from the command line (which involves bundling the class files into a JAR, copying it over to the tomcat webapps directory). My guess is that there is some way to set this up in MyEclipse so that it compiles and redeploys--but it is not exactly obvious how to set this up. I am using MyEclipse 9.1, Tomcat 5.0.28 (please don't laugh; we're working on moving into modern times, and getting rid of our papyrus and clay tablets). To simplify figuring out what is broken, I have taken the Oracle tutorial code and put in a single project, divided into three packages: client, compute, and engine. I can start the server (engine) with the following DOS batch file: java -cp "c:\Documents and Settings\ccramer\Workspaces\MyEclipse 9\rmi\src";c:\tomcat5\webapps\rmi\compute.jar -Djava.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\compute.jar -Djava.security.policy=server.policy engine.ComputeEngine I can run the client side from the command line with the following DOS batch file: view plaincopy to clipboardprint? java -cp "c:\Documents and Settings\ccramer\Workspaces\MyEclipse 9\rmi\src";c:\tomcat5\webapps\rmi\compute.jar -Djava.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\computer.jar -Djava.security.policy=client.policy client.ComputePi localhost %1% where %1% is the parameter passed to the batch file specifying the number of digits of pi to have the server side calculate and return. Then I tried to get MyEclipse to start the server in pretty much the equivalent way using the Run Configurations...: Main.class: engine.ComputeEngine Classpath: default classpath and c:\tomcat5\webapps\rmi\compute.jar Environment: java.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\compute.jar java.security.policy=server.policy Code: ComputeEngine exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: compute.Compute at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240) at sun.rmi.transport.Transport$1.run(Transport.java:153) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:595) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343) at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source) at engine.ComputeEngine.main(ComputeEngine.java:29) Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: compute.Compute at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source) at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240) at sun.rmi.transport.Transport$1.run(Transport.java:153) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.ClassNotFoundException: compute.Compute at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707) at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651) at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588) at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628) at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294) at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238) at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339) ... 9 more As you can see, there is a ClassNotFoundException: compute.Compute I'm hard pressed to see why. If I do a jar -tf c:\tomcat5\webapps\rmi\compute.jar I get: Code: META-INF/ META-INF/MANIFEST.MF compute/Compute.class compute/Task.class Any suggestions?
[toc] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2012-10-02 12:50 -0400 |
| Message-ID | <506b1b61$0$281$14726298@news.sunsite.dk> |
| In reply to | #19039 |
On 10/2/2012 12:16 PM, Clayton Cramer wrote: > I hope that I am asking this in the right group. > > 1. I am looking at the possibility of replacing our browser-based > JSP/Struts client talking to Java server classes with a thick client > written in Java. (Yes, for most enterprise systems, this would not > be a great idea, but for us it does make sense: we have a few hundred > PCs talking to our servers; there are never one time users connecting > to our servers unless it's a security breach.) > > 2. I I started with the Oracle demo where the client makes a request > for the value of pi to an arbitrary number of places, and the server > computes it and passes it back to the client. > > I was able to get this working using javac and jar from the command > line (which involves bundling the class files into a JAR, copying it > over to the tomcat webapps directory). My guess is that there is some > way to set this up in MyEclipse so that it compiles and > redeploys--but it is not exactly obvious how to set this up. > > I am using MyEclipse 9.1, Tomcat 5.0.28 (please don't laugh; we're > working on moving into modern times, and getting rid of our papyrus > and clay tablets). I would recommend against using RMI here. A web container is not a good RMI server. Expose the functionality as web services and let your fat client call those. > To simplify figuring out what is broken, I have taken the Oracle > tutorial code and put in a single project, divided into three > packages: client, compute, and engine. I can start the server > (engine) with the following DOS batch file: > > java -cp "c:\Documents and Settings\ccramer\Workspaces\MyEclipse > 9\rmi\src";c:\tomcat5\webapps\rmi\compute.jar > -Djava.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\compute.jar > -Djava.security.policy=server.policy engine.ComputeEngine > > I can run the client side from the command line with the following > DOS batch file: > > view plaincopy to clipboardprint? java -cp "c:\Documents and > Settings\ccramer\Workspaces\MyEclipse > 9\rmi\src";c:\tomcat5\webapps\rmi\compute.jar > -Djava.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\computer.jar > -Djava.security.policy=client.policy client.ComputePi localhost %1% > > where %1% is the parameter passed to the batch file specifying the > number of digits of pi to have the server side calculate and return. > > Then I tried to get MyEclipse to start the server in pretty much the > equivalent way using the Run Configurations...: > > Main.class: engine.ComputeEngine Classpath: default classpath and > c:\tomcat5\webapps\rmi\compute.jar Environment: > java.rmi.server.codebase=file:/c:\tomcat5\webapps\rmi\compute.jar > java.security.policy=server.policy > > Code: ComputeEngine exception: java.rmi.ServerException: > RemoteException occurred in server thread; nested exception is: > java.rmi.UnmarshalException: error unmarshalling arguments; nested > exception is: java.lang.ClassNotFoundException: compute.Compute at > sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385) > As you can see, there is a ClassNotFoundException: compute.Compute > > I'm hard pressed to see why. If I do a jar -tf > c:\tomcat5\webapps\rmi\compute.jar I get: > > Code: META-INF/ META-INF/MANIFEST.MF compute/Compute.class > compute/Task.class Can you check the actual java command used when running inside Eclipse? Arne
[toc] | [prev] | [next] | [standalone]
| From | Clayton Cramer <claytoncramer@gmail.com> |
|---|---|
| Date | 2012-10-15 15:03 -0700 |
| Message-ID | <fc19b83f-08c0-4485-8c41-e0fcb46a3f89@googlegroups.com> |
| In reply to | #19041 |
On Tuesday, October 2, 2012 10:50:41 AM UTC-6, Arne Vajhøj wrote: > Can you check the actual java command used when running inside > > Eclipse? > > > > Arne I am not sure how to see what MyEclipse actually produces. I suspect that there is some magic menu choice that shows this, but I am not sure what it is.
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-10-15 15:54 -0700 |
| Message-ID | <6ac1c566-880f-45f8-8a37-2d3f59d519fa@googlegroups.com> |
| In reply to | #19383 |
Clayton Cramer wrote: > Arne Vajhøj wrote: >> Can you check the actual java command used when running inside >> Eclipse? > > > I am not sure how to see what MyEclipse actually produces. > I suspect that there is some magic menu choice that shows this, but I am not sure what it is. http://help.eclipse.org/juno/topic/org.eclipse.jdt.doc.user/gettingStarted/qs-BasicTutorial.htm -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2012-10-16 03:20 -0400 |
| Message-ID | <k5j1fo$uuv$1@dont-email.me> |
| In reply to | #19383 |
On 10/15/2012 06:03 PM, Clayton Cramer wrote: > On Tuesday, October 2, 2012 10:50:41 AM UTC-6, Arne Vajhøj wrote: > >> Can you check the actual java command used when running inside >> >> Eclipse? >> >> >> >> Arne > > I am not sure how to see what MyEclipse actually produces. I suspect that there is some magic menu choice that shows this, but I am not sure what it is. Is this posting in any related to this two year old post at the MyEclipse Forums? <http://www.myeclipseide.com/PNphpBB2-viewtopic-t-29372.html> Just curious, my grasp of this technology isn't great enough for me to determine it.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2012-10-16 11:13 -0400 |
| Message-ID | <k5jt7c$pj7$1@dont-email.me> |
| In reply to | #19391 |
On 10/16/2012 03:20 AM, Jeff Higgins wrote: > Is this posting in any related to this two year old post at the > MyEclipse Forums? Oops.I should have slept a little longer. Make that several days rather than two years. > <http://www.myeclipseide.com/PNphpBB2-viewtopic-t-29372.html> > Just curious, my grasp of this technology isn't great enough for me to > determine it. >
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-10-02 12:58 -0700 |
| Message-ID | <gehm68pboe1g9edviavhjf4v8d7392ldp3@4ax.com> |
| In reply to | #19039 |
On Tue, 2 Oct 2012 09:16:22 -0700 (PDT), Clayton Cramer <claytoncramer@gmail.com> wrote, quoted or indirectly quoted someone who said : >1. I am looking at the possibility of replacing our browser-based JSP/Strut= >s client talking to Java server classes with a thick client written in Java= >. (Yes, for most enterprise systems, this would not be a great idea, but f= >or us it does make sense: we have a few hundred PCs talking to our servers;= > there are never one time users connecting to our servers unless it's a sec= >urity breach.) I reject of thin clients on many grounds: 1. inefficiency. 2. bugs introduced by the browser 3. you don't keystroke by keystroke validation 4. there is no logic to help you fill out a form when not all the fields are mandatory. The problem with RMI is you expose everything to the outside world, hopefully just an internal LAN. I did two projects of this sort. The server had a socket open to each terminal. The protocol was a continuous stream of large binary packets (most commonly image files). It had quite spectacular throughput. -- Roedy Green Canadian Mind Products http://mindprod.com The iPhone 5 is a low end Rolex.
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2012-10-02 16:23 -0400 |
| Message-ID | <506b4d46$0$292$14726298@news.sunsite.dk> |
| In reply to | #19048 |
On 10/2/2012 3:58 PM, Roedy Green wrote: > On Tue, 2 Oct 2012 09:16:22 -0700 (PDT), Clayton Cramer > <claytoncramer@gmail.com> wrote, quoted or indirectly quoted someone > who said : >> 1. I am looking at the possibility of replacing our browser-based JSP/Strut= >> s client talking to Java server classes with a thick client written in Java= >> . (Yes, for most enterprise systems, this would not be a great idea, but f= >> or us it does make sense: we have a few hundred PCs talking to our servers;= >> there are never one time users connecting to our servers unless it's a sec= >> urity breach.) > > I reject of thin clients on many grounds: > 1. inefficiency. And you are sure that it a problem because? > 2. bugs introduced by the browser Does browsers have more bugs than other environments? Swing may be relative stable, but JavaFX probably have a few oopses. > 3. you don't keystroke by keystroke validation Ever heard about AJAX? > 4. there is no logic to help you fill out a form when not all the > fields are mandatory. See above. Arne
[toc] | [prev] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2012-10-03 01:33 +0200 |
| Message-ID | <1vbgw1waz2o3u$.136t3q5fbc2ln.dlg@40tude.net> |
| In reply to | #19048 |
On Tue, 02 Oct 2012 12:58:02 -0700, Roedy Green wrote: > I reject of thin clients on many grounds: > 1. inefficiency. In what sense ? > 2. bugs introduced by the browser As others said, that seems to be not much more of an issue than bugs introduced by Swing or whatever. > 3. you don't keystroke by keystroke validation > 4. there is no logic to help you fill out a form when not all the > fields are mandatory. This kind of sounds like you are stuck in ca. 2000 web technology. Are there even still websites today for which the above is true, let alone future websites ? Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web