6 Replies Latest reply on Oct 11, 2011 6:09 AM by dkumaran

    JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]

    dkumaran

      Missing JNDI for the Datasoure error occurs while deploying the application  which looks up the datasource from JPA Unit.

       

      Using SQL-server jdbc driver and created the datasource.

       

      Error message from the console

       

       

      18:11:25,222 INFO  [org.jboss.as.server.controller] (HttpManagementService-threads - 10) Deployment of "core-api-1.0.0.1-SNAPSHOT.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"core-api-1.0.0.1-SNAPSHOT.war#DCJpaUnit\"

      ,"jboss.deployment.unit.\"core-api-1.0.0.1-SNAPSHOT.war\".jndiDependencyService missing [ jboss.naming.context.java.module.\"core-api-1.0.0.1-SNAPSHOT\".\"core-api-1.0.0.1-SNAPSHOT\".env/persistence/DKJpaUnit ]","jboss.persistenceunit.\"core-api-1.0.0.1-SNAPSHOT.war#DKJpaUnit\" missing [ jboss.naming.context.java.java:DKDS ]"]}

      18:11:25,237 INFO  [org.jboss.weld] (MSC service thread 1-3) Stopping weld service

      18:11:34,472 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment core-api-1.0.0.1-SNAPSHOT.war in 9257ms

        • 1. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
          jaikiran

          How have you configured your datasource? What does it look like?

          • 2. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
            dkumaran

            i have configured the Datasource using the web-console... and it's in green enabled mode.

             

            Is there anyway to check wheather the created datasource is available and how do i access it outside..

            • 3. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
              jaikiran

              What JNDI name did you configure it to? The standalone.xml would have the newly created datasource, so check that file. As for testing whether the datasource is functional, I think there is a test connection feature available in the admin console. I haven't checked recently, so can't say for sure.

              • 4. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
                dkumaran

                i can see the datasource name  created in the standalone.xml as follows.

                 

                <datasource jndi-name="DKDS" pool-name="DKDS_Pool" enabled="true">

                                    <connection-url>

                                        jdbc:jtds:sqlserver://localhost:1433/test

                                    </connection-url>

                                    <driver>

                                        sqljdbc4.jar

                                    </driver>

                                    <security>

                                        <user-name>

                                            qhg_engr_user

                                        </user-name>

                                        <password>

                                            *08oate

                                        </password>

                                    </security>

                                </datasource>

                • 5. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
                  jaikiran

                  I forgot to ask it earlier. What does your persistence.xml look like. It should use java:/DKDS (the front slash is necessary) as the jndi name of the datasource

                  • 6. Re: JBoss 7 AS  + JPA + missing [ jboss.naming.context.java.java:]
                    dkumaran

                    yes that was the problem,,,    awesome and thanks for the information... i was trying to access the JNDI as java:DKDS  just modified to java:/DKDS and it started working....

                     

                    once again thanks for the information i was strucked with this issue for the past two days..... and finally got resolved....