The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jjamel (4) [Avatar] Offline
#1
Hello Guys!

I'm trying to run the example mentionned in your book about jdbc connection using servicemix. I went through the steps mentionned in page 221 many time.

When I deploy into servicemix 3.3, I get the following warning:
WARN - AutoDeploymentService - Components sun-jdbc-binding are not installed yet: the service assembly jdbc-sa
deployment is suspended and will be resumed once the listed components are installed
INFO - AutoDeploymentService - Directory: hotdeploy: Finished installation of archive: chap06-connectivity-jd
bc-sa.zip

Running the test example does not effect.

Please could you help me to get through this issue.

Thanks.

jamel
tijs.rademakers (494) [Avatar] Offline
#2
Re: JDBC Connectivity
Hi Jamel,

Did you also execute the wsdl4j-sun.jar copy and wsdl-1.6.1 delete steps? And also important, copy the boxResources/jdbcbc.jar to the hotdeploy directory?

Best regards,

Tijs
jjamel (4) [Avatar] Offline
#3
Re: JDBC Connectivity
Hi Tijs,

Thanks a lot for your reply.

I did the following actions:

1- setup datasource jndi name in %SERVICEMIX_HOME%/config/config.xml;
2- copy wsdl4j-sun.jar into %SERVICEMIX_HOME%/lib
3- copy jdbcbc.jar into %SERVICEMIX_HOME%/lib
4- remove wsdl-1.6.1.jar from %SERVICEMIX_HOME%/lib
5- start servicemix container
7- deploy chap06-connectivity-jdbc-sa.zip

At this step the following warning occurs:
WARN - AutoDeploymentService - Components sun-jdbc-binding are not installed yet: the service assembly jdbc-sa
deployment is suspended and will be resumed once the listed components are installed
INFO - AutoDeploymentService - Directory: hotdeploy: Finished installation of archive: chap06-connectivity-jd
bc-sa.zip

What does mean is there are some sun-jdbc-binding artifacts missing.

Thanks.

jamel
tijs.rademakers (494) [Avatar] Offline
#4
Re: JDBC Connectivity
Hi Jamel,

I've just tested the installation on my local environment. I must note that I used ServiceMix 3.2.1, but there should be a difference with 3.3. I did the following actions:

1- setup datasource jndi name in %SERVICEMIX_HOME%/config/config.xml;
2- copy wsdl4j-sun.jar into %SERVICEMIX_HOME%/lib
3- remove wsdl-1.6.1.jar from %SERVICEMIX_HOME%/lib
4- start servicemix container
5- copy jdbcbc.jar into %SERVICEMIX_HOME%/hotdeploy (Note that this is not the lib directory but the hotdeploy directory!)
6- deploy chap06-connectivity-jdbc-sa.zip

This should work. Let me know if you are still experiencing problems.

Best regards,

Tijs
jjamel (4) [Avatar] Offline
#5
Re: JDBC Connectivity
Hi Tijs,

Thanks again for your reply.

Executing correctly the point #3 of your last reply, I was able to deploy but I got the following error stack:

INFO - AutoDeploymentService - Directory: hotdeploy: Archive changed: processing chap06-connectivity-jdbc-sa.zip ...
2-Jun-2009 10:24:12 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer deploy
INFO: Deploying service unit: jdbc-su from C:My Program Files$serversapache-servicemix-3.3datasmxservice-assemblie
sjdbc-saversion_1sussun-jdbc-bindingjdbc-su.
INFO - ServiceAssemblyLifeCycle - Starting service assembly: jdbc-sa
INFO - ServiceUnitLifeCycle - Initializing service unit: jdbc-file-su
INFO - ServiceUnitLifeCycle - Initializing service unit: jdbc-su
2-Jun-2009 10:24:12 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer init
INFO: Initializing service unit: jdbc-su from C:My Program Files$serversapache-servicemix-3.3datasmxservice-assembliesjdbc-saversion_1sussun-jdbc-bindingjdbc-su.
Cannot find CatalogManager.properties
Retrieving document at 'C:My Program Files$serversapache-servicemix-3.3datasmxservice-assembliesjdbc-saversion_1sussun-jdbc-bindingjdbc-suPERSON.wsdl'.
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer$DeployHelper deploy
INFO: About to parse jbi.xml to resolve service end point.
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer$DeployHelper deploy
INFO: JDBC binding operation insert sql INSERT into PERSON (id, name, processed) values (NULL, ?,FALSE)
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer$DeployHelper deploy
INFO: JDBC binding operation poll sql SELECT * FROM PERSON where processed = false
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingLifeCycle activateEndpoints
INFO: Activating endpoints
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingLifeCycle getServiceDescription
SEVERE: Endpoint nullCannot get the getServiceDescription Exception in Exception
java.lang.NullPointerException
at com.sun.jbi.jdbcbc.JDBCBindingLifeCycle.getServiceDescription(JDBCBindingLifeCycle.java:334)
at org.apache.servicemix.jbi.framework.Registry.getEndpointDescriptor(Registry.java:234)
at org.apache.servicemix.jbi.framework.support.WSDL2Processor.process(WSDL2Processor.java:61)
at org.apache.servicemix.jbi.framework.EndpointRegistry.registerInternalEndpoint(EndpointRegistry.java:203)
at org.apache.servicemix.jbi.framework.Registry.activateEndpoint(Registry.java:195)
at org.apache.servicemix.jbi.framework.ComponentContextImpl.activateEndpoint(ComponentContextImpl.java:126)
at com.sun.jbi.jdbcbc.JDBCBindingLifeCycle.activateEndpoints(JDBCBindingLifeCycle.java:441)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.processDeployment(JDBCBindingDeployer.java:226)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.init(JDBCBindingDeployer.java:18smilie
at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)
at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:123)
at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:37smilie
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:355)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2-Jun-2009 10:24:13 PM com.sun.jbi.internationalization.Messages getString
WARNING: Resource entry is missing from the resource bundle
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key INFO,SQLSE_R00319.SQLSESU_ENDPOINT_ACTIVATED
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at com.sun.jbi.internationalization.Messages.getString(Messages.java:277)
at com.sun.jbi.jdbcbc.JDBCBindingLifeCycle.activateEndpoints(JDBCBindingLifeCycle.java:447)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.processDeployment(JDBCBindingDeployer.java:226)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.init(JDBCBindingDeployer.java:18smilie
at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)
at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:123)
at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:37smilie
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:355)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingLifeCycle activateEndpoints
INFO: !INFO,SQLSE_R00319.SQLSESU_ENDPOINT_ACTIVATED!
2-Jun-2009 10:24:13 PM com.sun.jbi.internationalization.Messages getString
WARNING: Resource entry is missing from the resource bundle
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key IR_Started
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at com.sun.jbi.internationalization.Messages.getString(Messages.java:277)
at com.sun.jbi.jdbcbc.InboundReceiver.addInboundMessageProcessor(InboundReceiver.java:170)
at com.sun.jbi.jdbcbc.JDBCBindingLifeCycle.activateEndpoints(JDBCBindingLifeCycle.java:42smilie
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.processDeployment(JDBCBindingDeployer.java:226)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.init(JDBCBindingDeployer.java:18smilie
at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)
at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:123)
at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:37smilie
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:355)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.InboundReceiver addInboundMessageProcessor
INFO: !IR_Started!
2-Jun-2009 10:24:13 PM com.sun.jbi.internationalization.Messages getString
WARNING: Resource entry is missing from the resource bundle
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key IR_Shutdown
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at com.sun.jbi.internationalization.Messages.getString(Messages.java:277)
at com.sun.jbi.jdbcbc.InboundReceiver.addInboundMessageProcessor(InboundReceiver.java:199)
at com.sun.jbi.jdbcbc.JDBCBindingLifeCycle.activateEndpoints(JDBCBindingLifeCycle.java:42smilie
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.processDeployment(JDBCBindingDeployer.java:226)
at com.sun.jbi.jdbcbc.JDBCBindingDeployer.init(JDBCBindingDeployer.java:18smilie
at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)
at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:123)
at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:37smilie
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:355)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.InboundReceiver addInboundMessageProcessor
INFO: !IR_Shutdown!
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.InboundMessageProcessor run
INFO: Endpoint service name is [{0}] and endpoint name is [{1}].
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingLifeCycle activateEndpoints
INFO: End point activated
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer init
INFO: Successfully initialized service unit jdbc-su.
INFO - ServiceUnitLifeCycle - Starting service unit: jdbc-file-su
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.InboundMessageProcessor locateServiceEndpoint
INFO: IMP_locate_EP
INFO - ServiceUnitLifeCycle - Starting service unit: jdbc-su
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer start
INFO: Starting service unit: jdbc-su.
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.JDBCBindingDeployer start
INFO: Successfully started JDBC BC.
2-Jun-2009 10:24:13 PM com.sun.jbi.jdbcbc.InboundMessageProcessor execute
INFO: Received in-only message.
INFO - AutoDeploymentService - Directory: hotdeploy: Finished installation of archive: chap06-connectivity-jdbc-sa.zip
2-Jun-2009 10:24:14 PM com.sun.jbi.jdbcbc.InboundMessageProcessor processInOnly
SEVERE: Unexpected exception Occured while processing the MEP.
javax.jbi.messaging.MessagingException: Error occured while executing sql.
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:515)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.processInOnly(InboundMessageProcessor.java:343)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.execute(InboundMessageProcessor.java:277)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.run(InboundMessageProcessor.java:207)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Connection is broken: java.net.SocketException: Connection reset
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDatabaseConnection(InboundMessageProcessor.java:829)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:463)
... 4 more
2-Jun-2009 10:24:19 PM com.sun.jbi.jdbcbc.InboundMessageProcessor execute
INFO: Received in-only message.
2-Jun-2009 10:24:23 PM com.sun.jbi.jdbcbc.InboundMessageProcessor processInOnly
SEVERE: Unexpected exception Occured while processing the MEP.
javax.jbi.messaging.MessagingException: Error occured while executing sql.
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:515)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.processInOnly(InboundMessageProcessor.java:343)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.execute(InboundMessageProcessor.java:277)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.run(InboundMessageProcessor.java:207)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Connection is broken: java.net.SocketException: Connection reset
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDatabaseConnection(InboundMessageProcessor.java:829)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:463)
... 4 more
2-Jun-2009 10:24:29 PM com.sun.jbi.jdbcbc.InboundMessageProcessor execute
INFO: Received in-only message.
2-Jun-2009 10:25:58 PM com.sun.jbi.jdbcbc.InboundMessageProcessor processInOnly
SEVERE: Unexpected exception Occured while processing the MEP.
javax.jbi.messaging.MessagingException: Error occured while executing sql.
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:515)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.processInOnly(InboundMessageProcessor.java:343)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.execute(InboundMessageProcessor.java:277)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.run(InboundMessageProcessor.java:207)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Connection is broken: java.net.SocketException: Connection reset
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDatabaseConnection(InboundMessageProcessor.java:829)
at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObject(InboundMessageProcessor.java:463)
... 4 more

It seems like the wsdl was found and parsed, the database was hit but the error occurs at service part.

However, the DB logging stack:
[Server@e0e1c6]: 2009-06-02 22:07:18.374 HSQLDB server 1.9.0 is online
[Server@e0e1c6]: To close normally, connect and execute SHUTDOWN SQL
[Server@e0e1c6]: From command line, use [Ctrl]+[C] to abort abruptly
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.
[Server@e0e1c6]: A pre-9.0 client attempted to connect. We rejected them.

A part the error, I do have a couple of questions:
1- looking at jbi.xml within jdbcbc.xml, the classpath is refering to lib/wsdl4j.jar, what do you think about that; even I got the same error after renaming wsdl4j-sun.jar?;
2- why do you have provided in your code (book code) the implementation of the class org.apache.servicemix.jbi.deployment.DescriptorFactory?

Thanks.

Jamel