1 2 Previous Next 20 Replies Latest reply on Dec 23, 2013 7:48 AM by sachin.dhingra

    Application not getting deployed

    sachin.dhingra

      I have JBOSS EAP 6.1.0 and i have deployed my ear file which has structure like:

      Ear file:
        |_ conf folder contains logger property file
        |_ lib folder contains external jar files
        |_ META-INF folder contains application.xml file and manifest.MF file with no classpath entry
        |_ resources folder contains messages file
        |_ xsl folder
        |_jar file (This is the one i was referring)
        |_ war file

      I have some EJB's in my jar file which i am looking using JNDI lookup in some POJO class inside the jar file only, for that I am facing below error:

       

      14:46:20,079 ERROR [xxx] (ServerService Thread Pool -- 79) The following validation errors were found: checkForUrlContext: java:app/xxxEJB/TimerServiceBean

      14:46:20,080 DEBUG [xxx] (ServerService Thread Pool -- 79) The following validation errors were found: checkForUrlContext: java:app/xxxEJB/TimerServiceBean: javax.naming.NamingException: checkForUrlContext: java:app/xxxEJB/TimerServiceBean [Root exception is javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.]

          at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:464) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_26]

          at com.xxx.yyy.commons.HUBConfigValidator.stopAllTimers(HUBConfigValidator.java:261) [xxxEJB.jar:]

          at com.xxx.yyy.listener.xxxServerApplicationListener.contextInitialized(xxxServerApplicationListener.java:120) [classes:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_26]

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_26]

          at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

          at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.

          at com.ibm.ws.naming.java.javaURLContextFactory.isNameSpaceAccessable(javaURLContextFactory.java:98) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance(UrlContextFactory.java:82) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:584) [rt.jar:1.6.0_26]

          at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:533) [rt.jar:1.6.0_26]

          at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:459) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          ... 17 more


       

      The server.log shows below binding which is same what i am using in my code:

       

      10:46:43,349 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-8) JNDI bindings for session bean named TimerServiceBean in deployment unit subdeployment "xxxEJB.jar" of deployment "xxxServer.ear" are as follows:

       

          java:global/xxxServer/xxxEJB/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

          java:app/xxxEJB/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

          java:module/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

          java:global/xxxServer/xxxEJB/TimerServiceBean

          java:app/xxxEJB/TimerServiceBean

          java:module/TimerServiceBean

       

      My java code is:

       

      InitialContext context = new InitialContext();
      ITimerServiceLocal timerSerivceBean = (ITimerServiceLocal) context.lookup("java:app/xxxEJB/" + TimerServiceBean.class.getSimpleName());
      
      

       

      So when I looked closer for below lines I found why java InitialContext.lookup method is invoking the methods from com.ibm.ws.ejb.thinclient_7.0.0.jar so i removed the websphere specific jar file with java standard jar file (javax.ejb.jar, javax.jms.jar which only has the interfaces not the implementation of EJB methods or context lookup methods) to avoid compilation issues.

       

      14:46:20,080 DEBUG [xxx] (ServerService Thread Pool -- 79) The following validation errors were found: checkForUrlContext: java:app/xxxEJB/TimerServiceBean: javax.naming.NamingException: checkForUrlContext: java:app/xxxEJB/TimerServiceBean [Root exception is javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.]

          at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:464) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]

          at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) [com.ibm.ws.ejb.thinclient_7.0.0.jar:]


       

       

      By doing that I found it is not even deploying the my ear file for quite a long time and finally failed due to timeout and it is not logging anything to the log file (server.log and application.log) which it used to write when it is logging when used websphere specific jar file.

       

      Below is message that i found in .failed file under deployments folder:

      "JBAS015052:@@@ Did not receive a response to the deployment operation within the allowed timeout period [1200 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment."

       

      But server log file doesn't have any error or info whether it is deploying the ear file. Attached is server log file.

       

      I don't know what is happening here.

       

      Please help.

        • 1. Re: Application not getting deployed
          sachin.dhingra

          Does any one has any update in this issue?

          • 2. Re: Application not getting deployed
            wdfink

            I smy understanding correct and you include EE jars in your EAR?

            You should not do so.

            • 3. Re: Application not getting deployed
              sachin.dhingra

              These jar files are only having the interfaces but not the implementation.

               

              Is it not correct to put those jar file in the lib directory? From where my ear file will pick these files, from server modules?

               

              Please suggest.

              • 4. Re: Application not getting deployed
                sachin.dhingra

                I tried deploying the ear file after removing those Java EE jars i.e., javax.jms.jar etc from the lib directory of ear file but no luck still the log is same as attached before.

                • 5. Re: Application not getting deployed
                  sfcoy

                  Your application still contains IBM EJB client jars if the stack trace is still the same.

                   

                  In addition to that, note that the files in the "conf", "resources" and "xsl" directories of your EAR will be inaccessible to your application. Elements in the EAR file will not be available on the class path, unless (possibly) you have manifest class path entries for them in your JAR files.

                  • 6. Re: Re: Application not getting deployed
                    sachin.dhingra

                    No, Now my ear file doesn't contain those IBM EJB client jars. I have replaced them with J2EE specific jars which only has the interfaces not implementation. What i meant above is I even tried removing the jar files from the lib directory and deployed the ear file which still has log file contents same as i have attached in my first post i.e., when J2EE specific jar files was present in lib (no exception stack trace).

                     

                    Thanks for telling that elements ear will be accessible from jar iff jar file has them in manifest class path entries for them in your JAR files.

                     

                    Now I have added those conf, resources and xsl in my manifest.mf file under my jar file but behavior is same.

                     

                    Attached the server.log file.

                    • 7. Re: Application not getting deployed
                      wdfink

                      You should also not include J2EE api archives. All necessary API's are provided by the server.

                      • 8. Re: Re: Application not getting deployed
                        sachin.dhingra

                        That seems quite valid to me wolf.

                         

                        I have checked the modules section assuming the server will have J2EE archives in that and found below:

                         

                        1. <JBOSS_HOME>\modules\system\layers\base\javax\jms has only folder structure named api\main and it has jboss-jms-api_1.1_spec-1.0.1.Final-redhat-2.jar and modules.xml file.

                             -- I have done the extraction of them and found these are having abstract classes form JMS

                         

                        As it is not showing any exception, it is becoming hard to found the problem. Only thing it is keep on saying deploying app but then fail with time out error in <app_name>.failed file.

                        • 9. Re: Application not getting deployed
                          wdfink

                          You might add TRACE for the root-logger to see more informations. It might be a bug and you should use the latest version. In case of EAP6.1 you need a subscription or you might use EAP6.2.Beta which is available here JBoss AS Downloads for development use.

                          • 10. Re: Application not getting deployed
                            sachin.dhingra

                            I will try both TRACE for the root logger and newer version of the JBOSS to check what's going wrong here.

                             

                            Will update you guys.

                            • 11. Re: Re: Application not getting deployed
                              sachin.dhingra

                              I have tried the TRACE option and didn't find any thing (attached is the same).

                               

                              Along with that I am suspecting below thing might be causing this problem (don't know if this is the correct way):

                              1. My EJB.jar and Web.war file are using messages.properties file under resources folder, which is directly under the ear file by specifying below entry in MANIFEST.MF of respective jar * war file as:

                                   Class-Path: ./resources/

                               

                              Is this the correct way to do it? Please suggest.

                              • 12. Re: Re: Re: Application not getting deployed
                                sfcoy

                                It needs to be relative to the jar. Therefore:

                                Class-Path: ../resources/
                                

                                if the jar is in the root of the EAR.

                                • 13. Re: Re: Re: Application not getting deployed
                                  sachin.dhingra

                                  I even tried this but no help.

                                  • 14. Re: Re: Re: Re: Application not getting deployed
                                    sachin.dhingra

                                    By going to deeper level of debugging i.e., by placing sysout commands to code starting from the entry point of code I found logger is getting instantiated and i could able to write the logs to application specific log but it hangs to a place where it looks up the stateless session bean inside jar file the and calls it method (StopTimer).

                                     

                                    ITimerServiceLocal timerSerivceBean = (ITimerServiceLocal) context.lookup("java:app/xxxEJB/" + TimerServiceBean.class.getSimpleName());
                                    System.out.println("lookup done for TimerServiceBean");
                                    System.out.println(" " + timerSerivceBean.toString() + " ,TimerExists " + timerSerivceBean.isTimerAlreadyExists());
                                    timerSerivceBean.stopTimer((HashMap<String, String>) hubLogMap);  
                                    System.out.println("Called stopTimer");
                                    
                                    
                                    

                                     

                                     

                                    In above piece of code, in the server.log it is printing as:

                                    6:34:35,719 INFO  [stdout] (ServerService Thread Pool -- 105) lookup done for TimerServiceBean

                                     

                                     

                                    But not the sys out messages just after that i.e, where it is using 'timerSerivceBean' as a part of the sys out message.

                                     

                                    I have also checked the JNDI binding for TimerServiceBean which shown in log file as:

                                    16:34:34,755 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named

                                    TimerServiceBean in deployment unit subdeployment "xxxEJB.jar" of deployment "xxxServer.ear" are as follows:

                                     

                                        java:global/xxxServer/xxxEJB/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

                                        java:app/xxxEJB/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

                                        java:module/TimerServiceBean!com.xxx.yyy.commons.workflow.ITimerServiceLocal

                                        java:global/xxxServer/xxxEJB/TimerServiceBean

                                        java:app/xxxEJB/TimerServiceBean

                                        java:module/TimerServiceBean

                                     

                                     

                                    I have checked the "timerSerivceBean" is not null.

                                     

                                    I am not sure what's happening here.

                                     

                                    Any help will be appreciated.

                                    1 2 Previous Next