HELP ------ SQL Server - JBoss 3.0 - Template Example
jmejia424 Jun 20, 2002 3:04 AMCould someone please help me? I am trying to get Microsoft SQL Server 7 and JBoss 3.0. I am trying to get JBoss 3.0 to work with SQL Server. I have listed my configuration files and then at the bottom, the error message I get when I try to run the Example that is posted out on sourceforge. I can build the example and deploy it without any problem. By running the sample application, it does create the EntityTest table in my SQL Server database. However, throws an exception after that.
Please help!
Thanks,
Jeovanny
---------------------------------------------------------
My conf\login-config.xml is:
<application-policy name = "MSSQLDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">xx</module-option>
<module-option name = "userName">xx</module-option>
<module-option name = "password">xxx</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxDS,name=MSSQLDS</module-option>
</login-module>
</application-policy>
---------------------------------------------------------
My deploy\mssql-service.xml
<!-- ======================================================================-->
<!-- New ConnectionManager setup for Microsoft SQL Server 2000 driver -->
<!-- You may download the latest Microsoft JDBC driver from *Microsoft* -->
<!-- http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml&frame=true -->
<!-- Build jmx-api (build/build.sh all) and view for config documentation -->
<!-- ===================================================================== -->
<!-- Include a login module configuration named MSSQLDbRealm.
Update your login-conf.xml, here is an example for a
ConfiguredIdentityLoginModule:
<application-policy name = "MSSQLDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">xx</module-option>
<module-option name = "userName">xx</module-option>
<module-option name = "password">xxx</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
</login-module>
</application-policy>
NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
module-option name = "managedConnectionFactoryName"
must match the object name of the ConnectionManager you are configuring here.
-->
<!--comment out this line if you want component managed security or want
to use the default values in the ManagedConnectionFactoryProperties -->
MSSQLDbRealm
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
MSSQLDS
<config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://myserver:1433;DatabaseName=jboss</config-property>
<config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</config-property>
<!--set these only if you want only default logins, not through JAAS
<config-property name="UserName" type="java.lang.String">xx</config-property>
<config-property name="Password" type="java.lang.String">xxx</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-->
0
50
5000
15
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
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
---------------------------------------------------------
22:52:03,706 INFO [MainDeployer] Successfully completed deployment of package:
file:/C:/apiatech/jboss30/server/default/deploy/web-client.war
22:53:22,523 INFO [STDOUT] TestSessionBean.ejbCreate()
22:53:22,723 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
javax.ejb.EJBException: Sequence number is broken
at test.entity.TestEntityBean.ejbCreate(TestEntityBean.java:477)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersisten
ceManager.java:221)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.crea
teEntity(CachedConnectionInterceptor.java:270)
at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:728)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityC
ontainer.java:1116)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractIntercep
tor.java:73)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(Ent
itySynchronizationInterceptor.java:257)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
keHome(CachedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:134)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
tionInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:167)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:104)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1