Problems with sybase datasource configuration
preeti Oct 23, 2002 8:26 AMHi,
Sorry if this question is a repeat. I checked the forums but have not been able to get a solution, hence this.
I have recently switched to using jBoss 3.0 having earlier worked with jBoss 2.4. The database I am using is Sybase ASE 11.9.2 with jConnect 5.5 driver. I have made a custom configuration for my application in the JBOSS_HOME/server/MyApp location. All the required jars have been put in the JBOSS_HOME/server/MyApp/lib, the sybase-service.xml in the JBOSS_HOME/server/MyApp/deploy and login-conf.xml in the JBOSS_HOME/server/MyApp/conf as I have understood it should be.
My sybase-service.xml has this :
<!ENTITY mydbserver.jdbc_driver "com.sybase.jdbc2.jdbc.SybDriver">
<!ENTITY mydbserver.username "abc">
<!ENTITY mydbserver.password "abc">
<!ENTITY mydbserver.poolname "JBossDbPool">
<!ENTITY mydbserver.min_poolsize "1">
<!ENTITY mydbserver.max_poolsize "10">
<!ENTITY mydbserver.blocking_timeout "5000">
<!ENTITY mydbserver.idle_timeout "15">
]>
MyAppDbRealm
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
&mydbserver.poolname;
<config-property name="ConnectionURL" type="java.lang.String">&mydbserver.jdbc_url;</config-property>
<config-property name="DriverClass" type="java.lang.String">&mydbserver.jdbc_driver;</config-property>
<!--set these only if you want only default logins, not through JAAS-->
<config-property name="UserName" type="java.lang.String">&mydbserver.username;</config-property>
<config-property name="Password" type="java.lang.String">&mydbserver.password;</config-property>
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">
jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
&mydbserver.min_poolsize;
&mydbserver.max_poolsize;
&mydbserver.blocking_timeout;
&mydbserver.idle_timeout;
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
and I have included a realm in my login-conf.xml called MyAppDbRealm as
<application-policy name = "MyAppDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">abc</module-option>
<module-option name = "userName">abc</module-option>
<module-option name = "password">abc</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=JBossDbPool</module-option>
</login-module>
</application-policy>
The problem is 2 fold -
1) If I use the realm from login-conf.xml, I get a
'[JDBCFinderCommand] Failed to create finder results
java.lang.SecurityException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.(ConfigFile.java:97)
at sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source).....'
2) If I don't use the realm, I am able to login to my application and also fetch some data on the following page via a finder method, but the remaining data which is got via a SELECT statement fired from the application is not obtained.
The first exception thrown is
'ResourceException returning ManagedConnection to pool:
javax.resource.ResourceException: Could not cleanup: com.sybase.jdbc2.jdbc.SybSQLException: SET CHAINED command not allowed within multi-statement transaction.'
and the second exception is
Exception caught executing SQL
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).); - nested throwable: (org.jboss.resource.ResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).))
at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:106)
at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getConnection(JDBCCommand.java:694)
at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:167)
at org.jboss.ejb.plugins.jaws.jdbc.JDBCBeanExistsCommand.execute(JDBCBeanExistsCommand.java:58)........'
Any solutions for this ?
Apologize for making this question such a long one and probably testing a few people's patience along the way - just thought I should supply as much info. as possible.
Thanks in advance.
:)