2 Replies Latest reply on Dec 30, 2009 5:43 PM by Amy Nieves

    Weblogic javax.naming.NameNotFoundException - While trying to lookup

    Amy Nieves Newbie
      I'm trying to make a test Seam application in Weblogic 10.3 with JBoss Tools following the documentation's "Getting Started". After many hours trying to get the right dependencies in Weblogic and reading the documentation I got the application to deploy correctly, but I'm unable to create a simple action.

      I'm creating a Ping action as it is explained in http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/gettingstartedwithjbosstools.html. The page is displayed correctly but when I press the ping button I get the following error:

      javax.faces.FacesException: Error calling action method of component with id pingForm:ping
      ...
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: ping
      ...
      Caused by: javax.naming.NameNotFoundException: While trying to lookup 'F2F_SEAM-ear.PingBean/local' didn't find subcontext 'F2F_SEAM-ear'. Resolved ''; remaining name 'F2F_SEAM-ear/PingBean/local'
              at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
              at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
              at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
              at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
              at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
              at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
              at org.jboss.seam.Component.instantiate(Component.java:1364)
              at org.jboss.seam.Component.newInstance(Component.java:2122)
              ... 60 more



      This is my component.xml:



        • 1. Re: Weblogic javax.naming.NameNotFoundException - While trying to lookup
          Amy Nieves Newbie

          Sorry I didn't finish to paste the xml.




          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
               xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
               xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
               xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
               xmlns:web="http://jboss.com/products/seam/web" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:transaction="http://jboss.com/products/seam/transaction"
               xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                           http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                           http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                           http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                           http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                           http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                           http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd
                           http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd">
          
               <core:init debug="true" jndi-pattern="@jndiPattern@" />
          
               <core:manager concurrent-request-timeout="500"
                    conversation-timeout="120000" conversation-id-parameter="cid"
                    parent-conversation-id-parameter="pid" />
          
               <!--
                    Make sure this URL pattern is the same as that used by the Faces
                    Servlet
               -->
               <web:hot-deploy-filter url-pattern="*.seam" />
          
               <persistence:managed-persistence-context
                    name="entityManager" auto-create="true" persistence-unit-jndi-name="f2fDS" />
          
               <!--
                    <drools:rule-base name="securityRules"> <drools:rule-files>
                    <value>/security.drl</value> </drools:rule-files> </drools:rule-base>
          
                    <security:rule-based-permission-resolver
                    security-rules="#{securityRules}"/>
               -->
               <security:identity authenticate-method="#{authenticator.authenticate}"
                    remember-me="true" />
          
               <event type="org.jboss.seam.security.notLoggedIn">
                    <action execute="#{redirect.captureCurrentView}" />
               </event>
               <event type="org.jboss.seam.security.loginSuccessful">
                    <action execute="#{redirect.returnToCapturedView}" />
               </event>
          
               <mail:mail-session host="localhost" port="25" />
          
               <!-- For use with jBPM pageflow or process management -->
               <!--
                    <bpm:jbpm> <bpm:process-definitions></bpm:process-definitions>
                    <bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm>
               -->
          
          </components>



          I also read that in Weblogic the ejb's must be defined in the web.xml (http://seamframework.org/Community/Weblogic103SetupWithEjbBookingExample) so I added the following to my web.xml:



          <ejb-local-ref>
                 <ejb-ref-name>F2F_SEAM-ear/PingBean/local</ejb-ref-name>
               <ejb-ref-type>Session</ejb-ref-type>
               <local>com.prt.f2f.session.Ping</local>
          </ejb-local-ref>



          Where F2F_SEAM-ear is the name of my EAR. After this I still get the error.
          I don't know if the line


          <core:init debug="true" jndi-pattern="@jndiPattern@" />



          is configured correctly. Can someone point me to the right direction?


          Thanks.


          • 2. Re: Weblogic javax.naming.NameNotFoundException - While trying to lookup
            Amy Nieves Newbie

            I found the problem. I had to add java:comp/env/ to the JNDI pattern.