0 Replies Latest reply on Apr 6, 2011 7:41 AM by Ondrej Medek

    WS in WAR deploument dependency on DataSource

    Ondrej Medek Apprentice

      Hello,

       

      I have a single WebService in a WAR (as a servlet) and I am trying to define a deployment dependency on a DataSource for JBoss 5.1.0GA. So I have tried to create a jboss-web.xml:

       

      {code:xml}<jboss-web>

          <resource-ref>

              <res-ref-name>DataSource</res-ref-name>

              <jndi-name>java:/AdpartnerDS</jndi-name>

          </resource-ref>

          <depends>jboss.jca:service=DataSourceBinding,name=AdpartnerDS</depends>

          <!-- this one also not works well <depends>jboss.jdbc:datasource=AdpartnerDS,service=metadata</depends>  -->

      </jboss-web>{code}

       

      When I redeploy the DataSource AdPartnerDS, then the WAR is redeployed with error:

      {code}2011-04-06 13:04:02,812 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=jboss.web.deployment:war=/autonet state=Create mode=Manual requiredState=Installed

       

      java.lang.NullPointerException

          at org.jboss.web.deployers.WebModule.startModule(WebModule.java:117)

          at org.jboss.web.deployers.WebModule.start(WebModule.java:97)

          at sun.reflect.GeneratedMethodAccessor574.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

          at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)

          at $Proxy38.start(Unknown Source)

          at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)

          at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)

          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.system.ServiceController.doChange(ServiceController.java:688)

          at org.jboss.system.ServiceController.start(ServiceController.java:460)

      ...{code}

       

       

       

      I have been playing with jboss-dependency.xml, but no joy. How I should specify a dependency on the DataSource?

       

      Thanks