I'm having problems getting a connection from a JDBC pool initialized in
jBoss. I'm using the stock jboss_tomcat that I downloaded a few days ago
with no changes except in configuration, which are outlined below. It's
running on a Sun e10k. The code attempting to grab the connection is in a
JSP contained in a WAR which is in turn contained in an EAR and placed in
the deployment directory. Has anyone else experienced this?
In light of the recent discussion about port 1099, I verified that nothing
else is using it.
jboss.conf excerpt:
---
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
CODEBASE="../../lib/ext/">
<ARG TYPE="java.lang.String" VALUE="PDOM">
<ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>
---
jboss.jcml excerpt:
---
<mbean name="DefaultDomain:service=XADataSource,name=PDOM">
<attribute name="Properties"></attribute>
<attribute name="URL">jdbc:sybase:Tds:*removed host*:*removed
port*/*removed database*</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser">*removed username*</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">*removed password*</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">true</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>
---
jboss.properties:
---
jdbc.drivers=org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,com.sy
base.jdbc2.jdbc.SybDriver
---
console output excerpts:
---
[JDBC] Loaded JDBC-driver:com.sybase.jdbc2.jdbc.SybDriver
[Naming] Initializing
[Naming] [Naming] Started on port 1099
[Naming] Naming started on port 1099
[Naming] Initialized
[PDOM] Initializing
[PDOM] Initialized
[PDOM] Starting
[PDOM] XA Connection pool PDOM bound to java:/PDOM
[PDOM] org.jboss.minerva.xa.XADataSourceImpl created new Connection
(com.sybase.jdbc2.jdbc.SybConnection) with XAResource
org.jboss.minerva.xa.XAResourceImpl and XAConnection
org.jboss.minerva.xa.XAConnectionImpl.
[PDOM] No transaction right now.
[PDOM] Pool PDOM [0/0/Unlimited] gave out new object:
org.jboss.minerva.xa.XAConnectionImpl@242b11
[PDOM] Pool PDOM [0/1/Unlimited] returned object
org.jboss.minerva.xa.XAConnectionImpl@242b11 to the pool.
[PDOM] Started
---
index.jsp excerpt (see comments):
---
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.provider.url", "localhost:1099");
/* Had to specify the environment, however other JSP files served by jBoss
don't require this to use JNDI. Do JSP files within WARs/EARs operate in an
isolated environment? Does this have anything to do with my problem? */
PooledConnection pc = ((XADataSource)(new
InitialContext(env).lookup("java:/PDOM"))).getXAConnection(); /* Exception
occurs here. I tried other names such as "PDOM" and "/PDOM" but it always
comes back with the same thing. I once tried "java:comp/env/PDOM" and
"java:comp/env/jdbc/PDOM" but they came back with "comp not bound"(!). */
Connection con = pc.getConnection();
---
exception from console (also in JSP output):
---
javax.naming.NameNotFoundException: PDOM not bound
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:295)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:279)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
_0002findex_0002ejspindex_jsp_18._jspService(_0002findex_0002ejspindex_jsp_1
8.java:68)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
9)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:745)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:407)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
---
chris
"Technology that remains a tool only for the elite few is a failed
technology."
- Douglas E. Welch
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]