Subject | Re: How2 save javaobject in Firebird ? |
---|---|
Author | mozheyko_d |
Post date | 2004-12-18T07:46:02Z |
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
I use JBOSS-4.0.0, and i try to use Firebird as DefaultDS for jms
queues/topics and other internal use. I remove from "default" deploy
directory all features except:
/jbossweb-tomcat50.sar
/jms
ear-deployer.xml
jbossjca-service.xml
jboss-local-jdbc.rar
ejb-deployer.xml
firebird-ds.xml // NOT FROM EXAMPLES SEE BELOW
jboss-jdbc-metadata.sar
mail-service.xml
1) My firebird datasourse:
###############################
# deploy/firibird-ds.xml
###############################
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:firebirdsql:localhost/3050:/opt/firebird/bases/default.gdb?lc_ctype=UNICODE_FSS</connection-url>
<driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>
<user-name>JBOSS</user-name>
<password>somepassword</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<security-domain>FirebirdDBRealm</security-domain>
<metadata>
<type-mapping>Firebird</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
#############################################
2)
mv deploy/jms/hsqldb-jdbc-state-service.xml
deploy/jms/firebird-jdbc-state-service.xml
mv deploy/jms/hsqldb-jdbc2-state-service.xml
deploy/jms/firebird-jdbc2-state-service.xml
3)
and modify in files:
deploy/ejb-deployer.xml
deploy/jms/firebird-jdbc-state-service.xml
deploy/jms/firebird-jdbc2-state-service.xml
create_table_statements to firebird datatypes
4) modify conf/login-config.xml
...
<application-policy name = "FirebirdDBRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">jboss</module-option>
<module-option name = "userName">jboss</module-option>
<module-option name = "password">somepassword</module-option>
<module-option name =
"managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
</login-module>
</authentication>
</application-policy>
...
5) By your advice i modify
conf/standardjbosscmp-jdbc.xml
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>VARBINARY</jdbc-type>
<sql-type>BLOB</sql-type>
</mapping>
or
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>BLOB</jdbc-type>
<sql-type>BLOB</sql-type>
</mapping>
And after this steps i still have error:
2004-12-17 18:02:39,211 INFO [STDOUT] org.jboss.mq.SpyJMSException:
Could not store message: 1 msg=0 hard NOT_STORED PERSISTENT
queue=QUEUE.testQueue priority=4 lateClone=false hashCode=27291330; -
nested throwable: (org.firebirdsql.jdbc.field.TypeConvertionException:
Error converting to object.)
2004-12-17 18:02:39,212 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:802)
2004-12-17 18:02:39,213 INFO [STDOUT] at
org.jboss.mq.server.PersistentQueue.addMessage(PersistentQueue.java:38)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSQueue.addMessage(JMSQueue.java:131)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:402)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:378)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:136)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:153)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:270)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:136)
2004-12-17 18:02:39,230 INFO [STDOUT] at
org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:86)
2004-12-17 18:02:39,230 INFO [STDOUT] at
org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:356)
2004-12-17 18:02:39,231 INFO [STDOUT] at
org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
2004-12-17 18:02:39,231 INFO [STDOUT] at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
2004-12-17 18:02:39,231 INFO [STDOUT] at
java.lang.Thread.run(Thread.java:595)
2004-12-17 18:02:39,231 INFO [STDOUT] Caused by:
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.firebirdsql.jdbc.field.FBField.setObject(FBField.java:741)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.firebirdsql.jdbc.AbstractPreparedStatement.setObject(AbstractPreparedStatement.java:218)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:633)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.setBlob(PersistenceManager.java:894)
2004-12-17 18:02:39,233 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:832)
2004-12-17 18:02:39,233 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:787)
2004-12-17 18:02:39,233 INFO [STDOUT] ... 13 more
<rrokytskyy@a...> wrote:
> > I tried this mapping but receive same errors :(this with
>
> Can you send be your bean with test case privately? I will check
> my JBoss. BTW, which version do you use?Thank you, Roman.
>
> Roman
I use JBOSS-4.0.0, and i try to use Firebird as DefaultDS for jms
queues/topics and other internal use. I remove from "default" deploy
directory all features except:
/jbossweb-tomcat50.sar
/jms
ear-deployer.xml
jbossjca-service.xml
jboss-local-jdbc.rar
ejb-deployer.xml
firebird-ds.xml // NOT FROM EXAMPLES SEE BELOW
jboss-jdbc-metadata.sar
mail-service.xml
1) My firebird datasourse:
###############################
# deploy/firibird-ds.xml
###############################
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:firebirdsql:localhost/3050:/opt/firebird/bases/default.gdb?lc_ctype=UNICODE_FSS</connection-url>
<driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>
<user-name>JBOSS</user-name>
<password>somepassword</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<security-domain>FirebirdDBRealm</security-domain>
<metadata>
<type-mapping>Firebird</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
#############################################
2)
mv deploy/jms/hsqldb-jdbc-state-service.xml
deploy/jms/firebird-jdbc-state-service.xml
mv deploy/jms/hsqldb-jdbc2-state-service.xml
deploy/jms/firebird-jdbc2-state-service.xml
3)
and modify in files:
deploy/ejb-deployer.xml
deploy/jms/firebird-jdbc-state-service.xml
deploy/jms/firebird-jdbc2-state-service.xml
create_table_statements to firebird datatypes
4) modify conf/login-config.xml
...
<application-policy name = "FirebirdDBRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">jboss</module-option>
<module-option name = "userName">jboss</module-option>
<module-option name = "password">somepassword</module-option>
<module-option name =
"managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
</login-module>
</authentication>
</application-policy>
...
5) By your advice i modify
conf/standardjbosscmp-jdbc.xml
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>VARBINARY</jdbc-type>
<sql-type>BLOB</sql-type>
</mapping>
or
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>BLOB</jdbc-type>
<sql-type>BLOB</sql-type>
</mapping>
And after this steps i still have error:
2004-12-17 18:02:39,211 INFO [STDOUT] org.jboss.mq.SpyJMSException:
Could not store message: 1 msg=0 hard NOT_STORED PERSISTENT
queue=QUEUE.testQueue priority=4 lateClone=false hashCode=27291330; -
nested throwable: (org.firebirdsql.jdbc.field.TypeConvertionException:
Error converting to object.)
2004-12-17 18:02:39,212 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:802)
2004-12-17 18:02:39,213 INFO [STDOUT] at
org.jboss.mq.server.PersistentQueue.addMessage(PersistentQueue.java:38)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSQueue.addMessage(JMSQueue.java:131)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:402)
2004-12-17 18:02:39,226 INFO [STDOUT] at
org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:378)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:136)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:153)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:270)
2004-12-17 18:02:39,229 INFO [STDOUT] at
org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:136)
2004-12-17 18:02:39,230 INFO [STDOUT] at
org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:86)
2004-12-17 18:02:39,230 INFO [STDOUT] at
org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:356)
2004-12-17 18:02:39,231 INFO [STDOUT] at
org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
2004-12-17 18:02:39,231 INFO [STDOUT] at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
2004-12-17 18:02:39,231 INFO [STDOUT] at
java.lang.Thread.run(Thread.java:595)
2004-12-17 18:02:39,231 INFO [STDOUT] Caused by:
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.firebirdsql.jdbc.field.FBField.setObject(FBField.java:741)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.firebirdsql.jdbc.AbstractPreparedStatement.setObject(AbstractPreparedStatement.java:218)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:633)
2004-12-17 18:02:39,232 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.setBlob(PersistenceManager.java:894)
2004-12-17 18:02:39,233 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:832)
2004-12-17 18:02:39,233 INFO [STDOUT] at
org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:787)
2004-12-17 18:02:39,233 INFO [STDOUT] ... 13 more