2 Replies Latest reply on Sep 8, 2008 11:35 AM by braca

    Configuration Jsp & DataSource & JNDI

    braca

      Hello,
      I cant't deploy my Wepapp. It's a simple jsp with sql-Tags Application, deployed as a war. However, I can't connect to database OracleDS. I got the following error:

      21:04:30,602 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactory
      Binding,name=JmsXA' to JNDI name 'java:JmsXA'
      21:04:30,904 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding
      ,name=OracleDS' to JNDI name 'java:OracleDS'
      21:04:32,532 INFO [A] Bound to JNDI name: queue/A
      21:04:32,537 INFO [B] Bound to JNDI name: queue/B
      21:04:32,543 INFO [C] Bound to JNDI name: queue/C
      21:04:32,548 INFO [D] Bound to JNDI name: queue/D
      21:04:32,552 INFO [ex] Bound to JNDI name: queue/ex
      21:04:32,631 INFO [testTopic] Bound to JNDI name: topic/testTopic
      21:04:32,650 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
      21:04:32,654 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
      21:04:32,664 INFO [testQueue] Bound to JNDI name: queue/testQueue
      21:04:32,740 INFO [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
      21:04:32,801 INFO [DLQ] Bound to JNDI name: queue/DLQ
      21:04:32,831 INFO [TomcatDeployer] deploy, ctxPath=/FinanzManagerKUR, warUrl=.../tmp/deploy/tmp26089FinanzManage
      rKUR-exp.war/
      21:04:33,004 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      21:04:33,606 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      21:04:33,686 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      21:04:33,755 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] St
      arted in 33s:889ms
      21:05:26,102 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.lang.NullPointerException"
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:285)
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:168)
      at org.apache.taglibs.standard.tag.el.sql.QueryTag.doStartTag(QueryTag.java:94)

      My web.xml looks like this:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>FinanzManagerKUR</display-name>
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.jspx</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <resource-ref>
      JNDI DataSource for OracleDS database im JBoss
      <res-ref-name>OracleDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </web-app>

      My jboss-web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <resource-ref>
      <res-ref-name>OracleDS</res-ref-name>
      <jndi-name>java:OracleDS</jndi-name>
      </resource-ref>
      </jboss-web>

      Any idea what's wrong?
      Thanks for help
      braca