1 2 Previous Next 22 Replies Latest reply on Jan 25, 2012 4:36 AM by m_hess

    Problem running ejb3 tutorial examples

    ehognestad

      Hi guys.

       

      I have just downloaded jboss5 and maven 2.0.9 and I'm trying to run the stateless example. It fails with this error:

       

      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar

       

      no protocol: and
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar
              at org.jboss.maven.plugins.as.control.mojo.JbossAsControlDeployMojo.execute(JbossAsControlDeployMojo.java:95)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
              ... 16 more
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
              java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
              java.net.MalformedURLException: no protocol: and]
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:782)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
              at javax.naming.InitialContext.lookup(InitialContext.java:351)
              at org.jboss.jbossas.servermanager.Server.getServerConnection(Server.java:646)
              at org.jboss.jbossas.servermanager.Server.invoke(Server.java:861)
              at org.jboss.jbossas.servermanager.Server.deploy(Server.java:808)
              at org.jboss.maven.plugins.as.control.mojo.JbossAsControlDeployMojo.execute(JbossAsControlDeployMojo.java:90)
              ... 18 more
      Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
              java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
              java.net.MalformedURLException: no protocol: and
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
              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:466)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
              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:126)
              at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
              ... 24 more
      Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
              java.net.MalformedURLException: no protocol: and
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
              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:466)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
              at java.lang.Thread.run(Thread.java:595)
      Caused by: java.net.MalformedURLException: no protocol: and
              at java.net.URL.<init>(URL.java:567)
              at java.net.URL.<init>(URL.java:464)
              at java.net.URL.<init>(URL.java:413)
              at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
              at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
              at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
              at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
              at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
              at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
              at javax.naming.CompoundName.readObject(CompoundName.java:554)
              at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
              at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
              ... 6 more
      [INFO] ------------------------------------------------------------------------

       

      I have followed the tutorial instructions, and I am not able to find where the error might be.

       

      Anyone else experienced this problem?

       

      Best regards,

       

      Eivind

        • 1. Re: Problem running ejb3 tutorial examples
          jaikiran
          java.net.MalformedURLException: no protocol: and

           

          Did you change any file(s) like the jndi.properties?

          • 2. Re: Problem running ejb3 tutorial examples
            ehognestad

            Hi Jaikiran - thanks for the interest in my problem

             

            No I didn't change any property files, and the only property file I have is the jndi.properties file:

             

            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            java.naming.provider.url=localhost

             

            Do I need to change anything or add any property files?

             

            From the error it seems like an URL is missing from some configuration somewhere, but I am not able to find it...

             

            Best regards,

             

            Eivind

            • 3. Re: Problem running ejb3 tutorial examples
              jaikiran

              eivind hognestad wrote:

               



              Caused by: java.net.MalformedURLException: no protocol: and
                      at java.net.URL.<init>(URL.java:567)
                      at java.net.URL.<init>(URL.java:464)
                      at java.net.URL.<init>(URL.java:413)
                      at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
                      at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
                      at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
                      at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
                      at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
                      at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
                      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
                      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)   

              What command do you use to start the JBoss AS? And what is the host name of your machine?

              • 4. Re: Problem running ejb3 tutorial examples
                ehognestad

                I am using maven to start jboss actually, just like it says in the tutorial:

                 

                mvn clean install -PRunSingleTutorial

                Eivind
                • 5. Re: Problem running ejb3 tutorial examples
                  cullendw

                  try using java.naming.provider.url=jnp://localhost:1099 and obviously make sure jboss has started successfully and has bound to localhost

                  • 6. Re: Problem running ejb3 tutorial examples
                    jaikiran

                    I would have expected the tutorials to work without any changes, since it already uses localhost:1099.

                     

                    Looking at the exception stacktrace, I suspect it is related to the user's hostname or maybe the location where JBoss AS is installed.

                     

                    Eivind, can you post what the hostname of your system is? Also what exact path is JBoss AS installed at?

                    • 7. Re: Problem running ejb3 tutorial examples
                      cullendw

                      Hi Jaikiran,

                       

                      Thanks for the feedback. I completely agree with you that the examples should work out the box, however, I found it odd that he had an incomplete url specified in the properties file "java.naming.provider.url=localhost" which may be causing the exception (unless it defaults to port 1099?).

                      • 8. Re: Problem running ejb3 tutorial examples
                        ehognestad

                        Hi guys, sorry for the late response, and THANKS for the interest in my issue.

                         

                        First of all, my JBOSS AS is installed in D:/development/jboss so no problems with spaces in filenames, I also checked my java installations etc and I have no installations with whitespace in the path.

                         

                        I also think the java.naming.provider.url=localhost MIGHT be the problem, but what do I put there then? I tried to put http://localhost:1099 and the problem still remains. I saw another guy with the same problem in another forum, but without an answer.

                         

                        I just tried to run the examples with maven again now with:

                        mvn clean install -PRunSingleTutorial

                         

                        but like I said the problem still remains and I'm not able to find anywhere a URL could be missing...

                         

                        Are there any other config files that I could have overseen?

                         

                        I downloaded JBOSS 5 (latest version), and then the EJB3 tutorial files, installed maven and set the PATHS the way it says in the tutorial and in the respective websites.

                         

                        Best regards,

                         

                        Eivind

                        • 9. Re: Problem running ejb3 tutorial examples
                          jaikiran

                          Daniel Cullender wrote:

                           

                          I found it odd that he had an incomplete url specified in the properties file "java.naming.provider.url=localhost" which may be causing the exception (unless it defaults to port 1099?).

                          Hi Daniel,

                           

                          Yes, it does default to 1099 However, I didn't mean to sideline your answer (infact, I didn't even notice that the URL wasn't containing the port)

                           

                          but like I said the problem still remains and I'm not able to find  anywhere a URL could be missing...

                           

                          Are there any other config files that I  could have overseen?

                          Eivind, I still suspect that it might have something to do with your machine hostname. From the command prompt, please run the following command and post the output here:

                           

                          hostname
                          
                          • 10. Re: Problem running ejb3 tutorial examples
                            ehognestad

                            Running hostname command in command prompt gives: laptop-eivind

                             

                            Do I have to put this in the jndi.properties?

                            • 11. Re: Problem running ejb3 tutorial examples
                              jaikiran

                              eivind hognestad wrote:

                               

                              Running hostname command in command prompt gives: laptop-eivind

                               

                               

                              Looks OK to me. Atleast I don't see anything obviously wrong in there.

                               

                              eivind hognestad wrote:

                               

                               

                              Do I have to put this in the jndi.properties?

                               

                              I don't think that's going to help.

                               

                              If you are still running into this issue, then I'll take a more detailed look later tomorrow.

                              • 12. Re: Problem running ejb3 tutorial examples
                                jaikiran

                                I just went through that stacktrace and then mapped it to the code and this definitely has to do with where the jar containing some classes is being picked up from. That codebase location contains a folder named something like "xxx and yyy" which causes this issue. Please post the output of:

                                 

                                echo %JAVA_HOME%

                                 

                                echo %JBOSS_HOME%
                                

                                 

                                and

                                 

                                java -version
                                

                                 

                                from the command prompt from where you are running the tutorials. If that doesn't give us enough hints, then I have one other thing in mind, but let's first rule out the obvious ones.

                                • 13. Re: Problem running ejb3 tutorial examples
                                  ehognestad

                                  D:\development\workspaces\ems\br.com.ouvi.ems.monitoring>echo %JAVA_HOME%
                                  C:\java\jdk1.5.0_17

                                   

                                  D:\development\workspaces\ems\br.com.ouvi.ems.monitoring>echo %JBOSS_HOME%
                                  D:\development\jboss-5.1.0.GA

                                   

                                  D:\development\workspaces\ems\br.com.ouvi.ems.monitoring>java -version
                                  java version "1.5.0_17"
                                  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
                                  Java HotSpot(TM) Client VM (build 1.5.0_17-b04, mixed mode)

                                   

                                  D:\development\workspaces\ems\br.com.ouvi.ems.monitoring>

                                  • 14. Re: Problem running ejb3 tutorial examples
                                    jaikiran

                                    jaikiran pai wrote:

                                     

                                    If that doesn't give us enough hints, then I have one other thing in mind, but let's first rule out the obvious ones.

                                    Okay, here's what you can try - Since you saw this issue with the "stateless" tutorial, let's concentrate on that.

                                     

                                    - In the "stateless" folder, you will find the pom.xml file with the following contents:

                                     

                                    <properties>
                                        <ejb3.tutorial.client>org.jboss.tutorial.stateless.client.Client</ejb3.tutorial.client>
                                      </properties>

                                     

                                     

                                    Open that pom.xml in a text editor and add an additional property as follows:

                                     

                                    <properties>
                                        <ejb3.tutorial.client>org.jboss.tutorial.stateless.client.Client</ejb3.tutorial.client>
                                        <jboss.ejb3.tutorial.client.jvmargs>-verbose:class</jboss.ejb3.tutorial.client.jvmargs>
                                      </properties>

                                     

                                     

                                    - Now go back to the command prompt to the "stateless" folder and run the following command:

                                     

                                    mvn clean install -PRunSingleTutorial > classes.txt
                                    

                                     

                                     

                                    This is the same command that you use to run the tutorial, except that it redirects the output to classes.txt file. The -verbose:class param that we added is going to log the jar file path from where the classes are being loaded. That log is too verbose and hence the redirect to a file. I am hoping that those logs will give us some hints on which jars are being picked up.

                                     

                                    Once the run completes (i.e. control returns back to the command prompt), please attach the classes.txt to this forum thread.

                                    1 2 Previous Next