3 Replies Latest reply on Mar 30, 2009 1:23 PM by Jon Loe

    NameNotFoundException 'employeePerks' not bound

    Jon Loe Newbie

      hi all...

      i'm porting an application that works fine in Tomcat 6.6 to JBoss 4.2.3.GA. Using jdk 1.6.

      Here's my context.xml:

      
      <Context path="/employeePerks"
       debug="0"
       reloadable="true">
      
       <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
       connectionURL="xxx"
       alternateURL="xxx"
       roleBase="xxx"
       roleSubtree="false"
       roleName="xxx"
       roleSearch="uniqueMember={0}"
       userBase="xxx"
       userSubtree="true"
       userSearch="uid={0}" />
      
       <Resource
       name="jdbc/employeePerks"
       auth="Container"
       type="javax.sql.DataSource"
       maxActive="100"
       maxIdle="30"
       maxWait="10000"
       username="xxxx"
       password="xxxx"
       defaultAutoCommit="false"
       removeAbandoned="true"
       removeAbandonedTimeout="60"
       logAbandoned="true"
       validationQuery="xxxx"
       driverClassName="xxxx"
       url="xxxx"/>
      
      
      </Context>
      
      


      My web.xml:

      
      <resource-ref>
       <description>DB Connection</description>
       <res-ref-name>jdbc/employeePerks</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
      
      


      My datasource fiile:

      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>employeePerks</jndi-name>
       <connection-url>xxxx</connection-url>
       <driver-class>xxxx</driver-class>
       <user-name>xxxx</user-name>
       <password>xxxx</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       </local-tx-datasource>
      
      </datasources>
      
      
      


      My jboss-web.xml:

      
      <?xml version="1.0" encoding="UTF-8" ?>
      
      <jboss-web>
       <security-domain>/employeePerks</security-domain>
       <resource-ref>
       <res-ref-name>jdbc/employeePerks</res-ref-name>
       <jndi-name>java:/employeePerks</jndi-name>
       </resource-ref>
      
      </jboss-web>
      
      


      The application deploys fine, but when trying to login, I get this error:

      
      13:57:44,619 ERROR [JBossSecurityMgrRealm] Error during authenticate
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: employeePerks not bound]
       at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1215)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:758)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
       at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:488)
       at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:257)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.naming.NameNotFoundException: employeePerks not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1209)
       ... 15 more
      13:57:49,493 INFO [Server] Runtime shutdown hook called, forceHalt: true
      


      can anyone help out? thanks