You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Corsato Giovanni <gc...@mail.tim.it> on 2010/09/01 15:57:04 UTC

INFO HelloWorld Basic EJB Example

Hi,
I've followed the instructions on the web http://openejb.apache.org/hello-world.html to implement HelloWorld basic ejb example but I've got this error trying to run the client:

 ( OpenEJB 3.1.2 for WinXP SP3, java version "1.6.0_18",
 C:\Projects\EJB\helloworld is the working directory where are all the java files and where I compiled them with this statement:
 javac -cp %OPENEJB_HOME%\lib\javaee-api-5.0-2.jar -d . *.java):


C:\Projects\EJB\helloworld>java -cp %OPENEJB_HOME%\lib\openejb-client-3.1.2.jar;%OPENEJB_HOME%\lib\javaee-api-5.0-2.jar org.acme.HelloClient

Exception in thread "main" java.lang.NoClassDefFoundError: org/acme/HelloClient
Caused by: java.lang.ClassNotFoundException: org.acme.HelloClient
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.acme.HelloClient.  Program will exit.

I'm sure there is main class in HelloClient.java
Please, could you help me ?
Many thanks in advance,
Best regards,
Gianni Corsato (Italy, Rome)


RE: INFO HelloWorld Basic EJB Example

Posted by mid491 mid491 <mi...@hotmail.com>.
Hi,


I use OpenEJB in embedded mode to test my web services. All work fine with maven, but when I try to run tests from Eclipse (run as -> JUnit Tests) the adresse used by httpejbd is set to 0.0.0.0 ! :
  ** Starting Services ** NAME                 IP              PORT  2010-09-02 08:53:17,038 INFO  [log] jetty-6.1.212010-09-02 08:53:17,100 DEBUG [log] Container Server@130998 + org.mortbay.thread.QueuedThreadPool@2d09e0 as threadpool2010-09-02 08:53:17,100 DEBUG [log] started org.mortbay.thread.QueuedThreadPool@2d09e02010-09-02 08:53:17,163 DEBUG [log] Container org.mortbay.jetty.handler.ContextHandler@1afd9cc{/,null} + ErrorHandler@63f5af as errorHandler2010-09-02 08:53:17,163 DEBUG [log] starting JettyHttpServer$1@95f2902010-09-02 08:53:17,163 DEBUG [log] started JettyHttpServer$1@95f2902010-09-02 08:53:17,163 DEBUG [log] starting org.mortbay.jetty.handler.ContextHandler@1afd9cc{/,null}2010-09-02 08:53:17,163 DEBUG [log] starting ErrorHandler@63f5af2010-09-02 08:53:17,163 DEBUG [log] started ErrorHandler@63f5af2010-09-02 08:53:17,163 DEBUG [log] started org.mortbay.jetty.handler.ContextHandler@1afd9cc{/,null}2010-09-02 08:53:17,163 DEBUG [log] starting Server@1309982010-09-02 08:53:17,288 DEBUG [log] started org.mortbay.jetty.nio.SelectChannelConnector$1@1eb9fde2010-09-02 08:53:17,288 INFO  [log] Started SelectChannelConnector@0.0.0.0:42042010-09-02 08:53:17,288 DEBUG [log] started SelectChannelConnector@0.0.0.0:42042010-09-02 08:53:17,303 DEBUG [log] started Server@130998  httpejbd             0.0.0.0         4204    admin thread         127.0.0.1       4200    ejbd                 127.0.0.1       4201  -------

my endpointURI is set to 127.0.0.1 into the code and when running tests with Maven (mvn install) all works fine, the adresse is well set to 127.0.0.1 

I 've tried to change the default adresse with the properties "properties.setProperty("httpejbd.bind", "127.0.0.1");" but the still remains 0.0.0.0 at run time...
Did I miss something ? How to have the same adresse under Maven and Eclipse ?
thx ))