2 Replies Latest reply on Feb 13, 2003 6:57 AM by Lewis Henderson

    Mapping ejb-local-ref in web.xml onto jboss-web.xml

    Doug Palmer Newbie

      I've been trying to hook a .war up to an already deployed ejb jar using local references in JBoss 3.0.4. My web.xml file contains:

      <?xml version="1.0"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
      <display-name>Callout Unit Test Framework</display-name>


      <servlet-name>JUnitEETestServlet</servlet-name>
      JUnitEE test runner
      <servlet-class>org.junitee.servlet.JUnitEEServlet</servlet-class>


      <servlet-mapping>
      <servlet-name>JUnitEETestServlet</servlet-name>
      <url-pattern>/TestServlet/*</url-pattern>
      </servlet-mapping>

      <ejb-local-ref>
      <ejb-ref-name>ejb/UIDStream</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>org.charvolant.callout.base.UIDStreamHome</local-home>
      org.charvolant.callout.base.UIDStream
      </ejb-local-ref>

      <ejb-local-ref>
      <ejb-ref-name>ejb/Brigade</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>org.charvolant.callout.base.BrigadeHome</local-home>
      org.charvolant.callout.base.Brigade
      </ejb-local-ref>

      </web-app>

      and my jboss-web.xml file contains

      <?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">

      <jboss-web>
      <ejb-ref>
      <ejb-ref-name>ejb/UIDStream</ejb-ref-name>
      <jndi-name>ejb/member/UIDStream</local-jndi-name>
      </ejb-ref>
      <ejb-ref>
      <ejb-ref-name>ejb/Brigade</ejb-ref-name>
      <jndi-name>ejb/member/Brigade</local-jndi-name>
      </ejb-ref>
      </jboss-web>

      When I attempt to deploy this, I get the exception

      23:16:26,659 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@937b2df5{ url=file:/D:/jboss-3.0.4/server/default/deploy/callouttest.war, deployedLastModified=1039561073418 ) org.jboss.deployment.DeploymentException: ejb-local-ref: ejb/UIDStream, target not found, add valid ejb-link; -nested throwable: (javax.naming.NamingException:
      ejb-local-ref: ejb/UIDStream, target not found, add valid ejb-link)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:436)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:561)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
      Caused by: javax.naming.NamingException: ejb-local-ref: ejb/UIDStream, target not found, add valid ejb-link
      at org.jboss.web.AbstractWebContainer.linkEjbLocalRefs(AbstractWebContainer.java:652)
      at org.jboss.web.AbstractWebContainer.parseWebAppDescriptors(AbstractWebContainer.java:462)
      at org.jboss.web.AbstractWebContainer$DescriptorParser.parseWebAppDescriptors(AbstractWebContainer.java:954)
      at org.jboss.jetty.JBossWebApplicationContext.setUpENC(JBossWebApplicationContext.java:310)
      at org.jboss.jetty.JBossWebApplicationContext.startHandlers(JBossWebApplicationContext.java:272)
      at org.mortbay.http.HttpContext.start(HttpContext.java:1763)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:471)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:414)
      ... 17 more

      I can see ejb/member/UIDStream in the JNDIView tree.

      Looking at the jboss-web DTD, only jndi-name is allowed, with no local-jndi-name. I'm assuming that the same entity will work for both local and remote lookups (?).

      Can anybody see what I'm doing wrong? Are local ejb-refs supported?