users@glassfish.java.net

Re: Establishing two Connections in One Application - One javax.jms.Connection, the other java.sql.Connection

From: rdblaha1 <rd_blaha_at_hotmail.com>
Date: Mon, 31 Mar 2008 07:18:50 -0700 (PDT)

I am struggling with this. As noted below I have tried the following
without any success.

1) With the classpaths set as noted previously I used the following command
line:

/opt/SUNWappserver/appclient -classpath
/opt/SUNWappserver/ifx2_21_jc5/ifxjdbc.jar:/opt/SUNWappserver/ifx2_21_jc5/ifxjdbcx.jar
-client dist/<myJarFileName> queue

2) Placed the ifxjdbc files in my properties in my NB project (I didn't
expect this to work since reference to ifx is only from a resource, but
anyway I am covering possibilities). Here I used the command line:

/opt/SUNWappserver/appclient -client dist/<myJarFileName> queue



In either of the above cases I had the same stacktrace results:

Mar 31, 2008 9:41:09 AM com.sun.gjc.common.DataSourceObjectBuilder
getDataSourceObject
SEVERE: RAR5099 : Wrong class name or classpath for Datasource Object
java.lang.ClassNotFoundException: com.informix.jdbcx.IfxDataSource
        at
com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:737)
        at
com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:627)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at
com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:242)
        at
com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:109)
        at
com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:972)
        at
com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:141)
        at
com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:95)
        at
com.sun.enterprise.resource.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:68)
        at
com.sun.enterprise.resource.AbstractResourcePool.createSingleResource(AbstractResourcePool.java:891)
        at
com.sun.enterprise.resource.AbstractResourcePool.createResourceAndAddToPool(AbstractResourcePool.java:1750)
        at
com.sun.enterprise.resource.AbstractResourcePool.createResources(AbstractResourcePool.java:917)
        at
com.sun.enterprise.resource.AbstractResourcePool.initPool(AbstractResourcePool.java:225)
        at
com.sun.enterprise.resource.AbstractResourcePool.internalGetResource(AbstractResourcePool.java:516)
        at
com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:443)
        at
com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
        at
com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
        at
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:327)
        at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:235)
        at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
        at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)
        at
com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:108)
        at com.davisco.mtr.server.<myJavaFile>.main(<myJavaFile>.java:103)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:417)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
        at com.sun.enterprise.appclient.Main.main(Main.java:200)
Mar 31, 2008 9:41:09 AM
com.sun.enterprise.resource.LocalTxConnectorAllocator createResource
WARNING: RAR5038:Unexpected exception while creating resource
Mar 31, 2008 9:41:09 AM com.sun.enterprise.connectors.ConnectionManagerImpl
internalGetConnection
WARNING: RAR5117 : Failed to obtain/create connection from connection pool [
ifxDevel ]. Reason : Class name is wrong or classpath is not set for :
com.informix.jdbcx.IfxDataSource
Mar 31, 2008 9:41:09 AM com.sun.gjc.spi.base.DataSource getConnection
WARNING: RAR5114 : Error allocating connection : [Error in allocating a
connection. Cause: Class name is wrong or classpath is not set for :
com.informix.jdbcx.IfxDataSource]
Mar 31, 2008 9:41:09 AM com.sun.enterprise.appclient.MainWithModuleSupport
<init>
WARNING: ACC003: Application threw an exception.
java.sql.SQLException: Error in allocating a connection. Cause: Class name
is wrong or classpath is not set for : com.informix.jdbcx.IfxDataSource
        at
com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
        at com.davisco.mtr.server.<myJavaFile>.main(<myJavaFile>.java:103)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:417)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
        at com.sun.enterprise.appclient.Main.main(Main.java:200)
Exception in thread "main" java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:428)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
        at com.sun.enterprise.appclient.Main.main(Main.java:200)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:417)
        ... 2 more
Caused by: java.sql.SQLException: Error in allocating a connection. Cause:
Class name is wrong or classpath is not set for :
com.informix.jdbcx.IfxDataSource
        at
com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
        at com.davisco.mtr.server.<myJavaFile>.main(<myJavaFile>.java:103)
        ... 8 more


I have verified that the 'com.informix.jdbcx.IfxDataSource.class' is in the
ifxjdbcx.jar file I am using. I have reviewed the permisisons in the
respective directories for the files I am attempting to use.

Are there any observations or suggestions that will profitably help me get
through this problem? Thank you.

NOTE: Here are excerpts from my code relating to this problem.

As part of class definitions:

    @Resource(name = "jdbc/ifxDevel")
    private static DataSource jdbcIfxDevel;

As part of main():

        java.sql.Connection sqlConn = null;
                
        sqlConn = jdbcIfxDevel.getConnection(); // This is where the
failure occurs.






-- 
View this message in context: http://www.nabble.com/Establishing-two-Connections-in-One-Application---One-javax.jms.Connection%2C-the-other--java.sql.Connection-tp15747720p16396266.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.