8 Replies Latest reply: Jan 19, 2009 1:36 PM by 843833 RSS

    I cannot get petstore to work on vista or linux!!

    843833
      Here is the output from glassfish console.

      WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8081
      WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8182
      WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 4849
      naming.bind
      Null component com.sun.appserv:type=JspMonitor,name=jsp,WebModule=//server/petstore,J2EEApplication=null,J2EEServer=server
      WEB0207: Error starting web context StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[petstore] on virtual server server
      java.lang.RuntimeException: java.lang.RuntimeException: javax.naming.NameNotFoundException
      at com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits(WebModuleListener.java:193)
      at com.sun.enterprise.web.WebModuleListener.lifecycleEvent(WebModuleListener.java:168)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:143)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5094)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
      at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
      at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
      at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException
      at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(PersistenceUnitInfoImpl.java:283)
      at com.sun.enterprise.server.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:116)
      at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:121)
      at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:84)
      at com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits(WebModuleListener.java:190)
      ... 13 more
      Caused by: javax.naming.NameNotFoundException
      at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:268)
      at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:191)
      at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
      at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
      at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at com.sun.enterprise.connectors.ConnectorResourceAdminServiceImpl.lookup(ConnectorResourceAdminServiceImpl.java:196)
      at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:1099)
      at com.sun.enterprise.server.PersistenceUnitInfoImpl.lookupPMDataSource(PersistenceUnitInfoImpl.java:294)
      at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(PersistenceUnitInfoImpl.java:281)
      ... 17 more
      ....

      EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
      LDR5010: All ejb(s) of [__ejb_container_timer_app] loaded successfully!
      .....


      When I try to connect to http://localhost:8081/petstore I get this:
      HTTP Status 503 -

      type Status report

      message

      descriptionThe requested service () is not currently available.
      Sun Java System Application Server 9.1_02

      I know there are various posts about this exact same error, but most say "it simply went away". The one direct solution I found was saying to set build.properties and app-server.properties, which I have done. (I have also setup the passwordfile as instructed).

      This error has yet to "simply go away" for me even with various fresh installs.

      I realize it is quite likely I'm doing something very stupid, and by all means feel free to belittle me in any manner you see fit, so long as you properly enlighten me as to what I'm doing wrong!

      Thanks....
        • 1. Re: I cannot get petstore to work on vista or linux!!
          843833
          It wouldn't let me post everything I wanted to in one post (over 5000..). Both the glassfish app-server and javadb are running. I can log into the Admin Console and twiddle with things. I have successfully deployed a simple "Hello world". What is more mysterious to me is the javadb. I start it with NetBeans. I see the path as "/opt/jdk1.6.0_10/db" when I select the properties for the database in NetBeans. I tried setting this in the app-server.properties file:

          #db.home=${javaee.home}/javadb
          db.home=/opt/jdk1.6.0_10/db

          But still no luck.

          I think my problem may have something to do with the database setup, but not knowing much about it, I'm not too sure what to do.
          • 2. Re: I cannot get petstore to work on vista or linux!!
            843833
            I also get these messages:

            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.XWS_ClientProvider.property.signature.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "domain.applications.lifecycle-module.JBIFramework.property.com.sun.jbi.home"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.XWS_ServerProvider.property.encryption.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ClientProvider.property.security.config"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ClientProvider.property.encryption.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ServerProvider.property.security.config"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.applications.lifecycle-module.JBIFramework.property.com.sun.jbi.home"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ClientProvider.property.dynamic.username.password"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ServerProvider.property.signature.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.XWS_ClientProvider.property.dynamic.username.password"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.XWS_ClientProvider.property.encryption.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ClientProvider.property.signature.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.ServerProvider.property.encryption.key.alias"
            javax.management.InstanceNotFoundException: No object matches the specified name "server.security-service.message-security-config.SOAP.provider-config.XWS_ServerProvider.property.signature.key.alias"
            • 3. Re: I cannot get petstore to work on vista or linux!!
              843833
              I ran the Verifier for the hoot of it. Here's what I got:

              Web application's param-value exists. Please refer to 3D for further information.
              For [ petstore ]
              param-value must not be an empty string.
              For [ petstore ]
              param-value must not be an empty string.
              • 4. Re: I cannot get petstore to work on vista or linux!!
                843833
                Oy. I finally patched together something that works for me. However, it is still extremely frustrating that I could not get to root cause as to why the other method was not working. I can only hope that as I learn more it will become apparent what was wrong.

                What I was doing that DID NOT work for Vista or Linux:
                1) I downloaded and installed netbeans 6.5 from here (http://www.netbeans.org/downloads/index.html) with glassfish v2 and v3.
                2) I downloaded and installed the petstore project.
                3) I setup properties.
                4) Build and Deploy.
                5) Results -> more lost hair.

                What I did that DID work for Vista (have not tried Linux)
                1) I downloaded the "GlassFish Java EE + Tools Java EE 5 Tools Bundle" from here (This includes NetBeans 6.1)
                http://java.sun.com/javaee/downloads/index.jsp
                2) I downloaded and installed the petstore project
                3) I setup properties
                4) Make sure javadb is running in services window. ( I changed the path to the glassfish install dir version of javadb, but I'm not sure this was necessary, and I'm not sure why NetBeans pointed to a different one? But doing this made it match the path in the petstore properties).
                5) Build.
                6) add my Vista machine name to windows "hosts" file. (It seems that the machine name goes to a IPv6 name and not localhost, so when it tries to create the PetstoreDB it cannot connect to the server. So I used the hosts file to point the machine name to 127.0.0.1 - I don't really understand how/why the setup.xml gets the machine name and not localhost or why it would not connect?)
                7) In the petstore directory under the setup subdirectory, I ran:
                C:\Sun\AppServer\bin\asant.bat -buildfile setup.xml
                (This seems to be the only way to setup the initial PetstoreDB database tables, I do not know why this could not be done in the GUI build?)
                8) Deploy
                9) Results -> not totally bald.

                So my questions are:
                1) Why could I not get it to work with NetBeans 6.5. I should go back and see if it would work once I setup the hosts file, but the errors I was getting did not seem to be database connecton related. Furthermore, this seemed to be Vista(/windows) specific problem, and I was getting the same exact exception thrown in Linux.
                2) Why can't the PetstoreDB be properly created from the GUI?

                Well, maybe this will help someone else keep some more hair. I was lulled into a false conception that this would be easy by this quote on the petstore home page:
                "The Java Pet Store 2.0 is NetBeans-ready! Just open the petstore as a project in Netbeans and build and deploy it."
                My hats off to whoever can get it to work that easilly!

                Edited by: robertgass on Jan 2, 2009 4:23 PM
                • 5. Re: I cannot get petstore to work on vista or linux!!
                  843833
                  Well, it turns out that the magic step was running ant on the setup.xml to get the database setup properly.

                  ~/javapetstore-2.0-ea5/setup$ ~/glassfish-v2ur2/bin/asant -buildfile setup.xml

                  After doing the above it worked fine with NetBeans 6.5 on Linux.
                  • 6. Re: I cannot get petstore to work on vista or linux!!
                    843833
                    So, someone on one of the other threads for this problem hit the nail on the head.

                    " [Dukes Earned 0] aclockwiseorange
                    Posts:2
                    Registered: 3/3/08
                         
                    Re: Problem accessing PetStore app
                    Mar 19, 2008 1:42 AM (reply 9 of 12) (In reply to #7 )
                         
                    do not use IDE to deploy/run.

                    use
                    asant setup
                    asant run
                    "

                    I don't have the glassfish bin dir in my path so I ran like this:
                    cd ~/javapetstore-2.0-ea5
                    ~/glassfish-v2ur2/bin/asant setup
                    ~/glassfish-v2ur2/bin/asant run

                    Run failed for me with the following message:
                    bp-project/command-line-ant-tasks.xml:138: Execute failed: java.io.IOException: Cannot run program "${browser}": java.io.IOException: error=2, No such file or directory

                    But, it didn't seem to matter. Looks as if it's just trying to launch a browser?


                    Just running ant on the setup.xml left some of the other features not working (such as search).

                    So, Can anyone really build this ONLY using NetBeans?

                    Edited by: robertgass on Jan 2, 2009 7:16 PM
                    • 7. Re: I cannot get petstore to work on vista or linux!!
                      843833
                      Ok. So, the really stupid thing I missed in the instructions was this:
                      "In the Files window, expand the setup folder, right-click setup.xml, and choose Run Target > setup. The values you specified above are used to set up the environment. "

                      Now, I'm not trying to shift the blame for me not RTFM closely. However, I think what threw me is that this was not a Numbered step in the instructions. If you ask me this should be clearly marked as step 9.

                      Furthermore, Maybe it should be:
                      "9) In the Files window *right-click build.xml, and choose Run Target > Other Targets > setup.* The values you specified above are used to set up the environment. "
                      • 8. Re: I cannot get petstore to work on vista or linux!!
                        843833
                        Will you see my post (Oggie_Svennson)?

                        My first problem was when I tried to install javaee5-samples-1.0-installer.jar. I got an exception,

                        bp-project\app-client-ant.xml
                        Exception in thread "main" java.io.FileNotFoundException: bp-project\app-client-
                        ant.xml (El sistema no puede encontrar la ruta especificada) => (System unable to find the specified path)
                        at java.io.FileOutputStream.open(Native Method)
                        at java.io.FileOutputStream.<init>(Unknown Source)
                        at java.io.FileOutputStream.<init>(Unknown Source)
                        at com.sun.tools.xjc.installer.Main.install(Main.java:112)
                        at com.sun.tools.xjc.installer.Main.main(Main.java:63)

                        I have installed Glassfish v2ur2 integrated on NetBeans 6.5 IDE on Windows Vista Home Premium. I have been reading your post and I would not like to go back to NetBeans 6.1.

                        Did you find a solution for this issue?

                        Thanking in advance,
                        Jose Alvarez de Lara (Oggie_Svennson)