1 Reply Latest reply on Oct 17, 2002 4:52 AM by patrick

    Accessing EJB Interest from servlet

    Janulrich01 Newbie

      I've got a problem with running an example InterestServlet in spite of the fact the InterestClient runs correctly. I've got the message:


      root cause

      javax.naming.NamingException: Cannot create resource instance
      at org.apache.naming.factory.EjbFactory.getObjectInstance(Unknown Source)


      javax.servlet.ServletException: Cannot create resource instance
      at org.jboss.docs.interest.InterestServlet.init(org/jboss/docs/interest/InterestServlet.java:48)

      ...
      ...
      ...

      root cause

      javax.naming.NamingException: Cannot create resource instance
      at org.apache.naming.factory.EjbFactory.getObjectInstance(Unknown Source)


      ...
      ...
      ...
      My web.xml sounds like this:

      <servlet-name>interest</servlet-name>
      <servlet-class>org.jboss.docs.interest.InterestServlet</servlet-class>



      <servlet-mapping>
      <servlet-name>interest</servlet-name>
      <url-pattern>/interestServlet</url-pattern>
      </servlet-mapping>


      <ejb-ref>
      <ejb-ref-name>interest/Interest</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      org.jboss.docs.interest.Interest
      org.jboss.docs.interest.InterestBean
      </ejb-ref>


      I can see interest/Interest on http://localhost:8082/
      My java application (InterestClient) works correctly.

      I do not have an EAR file (what's this?) and I havn't defined the jboss-web.xml file (where should it be copied and why?).


      I'll appreciate any help.

      Jan Ulrich

        • 1. Re: Accessing EJB Interest from servlet
          patrick Novice

          The file should look like this
          And it is packeged in the same place as the web.xml

          Only the jndi mapping i still do not get so sorry about that.

          <?xml version="1.0" encoding="UTF-8"?>

          <jboss-web>
          <security-domain>java:/jaas/Anachron</security-domain>
          <ejb-ref>
          <ejb-ref-name>ejb/remote/UserFacade</ejb-ref-name>
          <jndi-name>UserFacadeJNDI</jndi-name>
          </ejb-ref>
          <ejb-ref>
          <ejb-ref-name>ejb/remote/NotificationFacade</ejb-ref-name>
          <jndi-name>NotificationFacadeJNDI</jndi-name>
          </ejb-ref>
          <ejb-ref>
          <ejb-ref-name>ejb/remote/ContentDataFacade</ejb-ref-name>
          <jndi-name>ContentDataFacadeJNDI</jndi-name>
          </ejb-ref>
          </jboss-web>