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.

Don Stadler (74) [Avatar] Offline
#1
When I tried following the instructions on page 230 I saw difficulties in the ServiceMix startup log. When I put the PEtALS JDBC component zip file into the hotdeploy directory the problems began immediately, though the log excerpts below are from a later startup.


[java] INFO - ServiceUnitLifeCycle - Starting service unit: SU-c
hapter6-mail-sender
[java] ERROR - DeploymentService - Unable to restore state for
service assembly SA-mail-sender
[java] java.lang.NullPointerException
[java] at org.ow2.petals.component.framework.su.ServiceUnitManager.proc
[java] at org.ow2.petals.component.framework.su.ServiceUnitManager.star
t(ServiceUnitManager.java:380)
[java] at org.ow2.petals.component.framework.su.BindingComponentService
UnitManager.start(BindingComponentServiceUnitManager.java:62)
[java] at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.star
t(ServiceUnitLifeCycle.java:103)
[java] at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.
start(ServiceAssemblyLifeCycle.java:132)
[java] at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.
restore(ServiceAssemblyLifeCycle.java:330)
[java] at org.apache.servicemix.jbi.framework.DeploymentService.start(D
eploymentService.java:100)
[java] at org.apache.servicemix.jbi.container.JBIContainer.start(JBICon
tainer.java:63smilie
[java] at org.apache.servicemix.jbi.container.SpringJBIContainer.afterP
ropertiesSet(SpringJBIContainer.java:115)
[java] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
[java] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
[java] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:251)
[java] at org.springframework.beans.factory.support.DefaultSingletonBea
nRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:24smilie
[java] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:160)
[java] at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
[java] at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:352)
[java] at org.apache.xbean.spring.context.FileSystemXmlApplicationConte
xt.<init>(FileSystemXmlApplicationContext.java:149)
[java] at org.apache.xbean.spring.context.FileSystemXmlApplicationConte
xt.<init>(FileSystemXmlApplicationContext.java:100)
[java] at org.apache.servicemix.Main.main(Main.java:67)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.codehaus.classworlds.Launcher.launchStandard(Launcher.jav
a:410)
[java] at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
[java] at org.codehaus.classworlds.Launcher.main(Launcher.java:461)

Then the following exception repeats after the


[java] 03-Dec-2008 17:17:17 com.sun.jbi.jdbcbc.InboundMessageProcessor exec
ute
[java] INFO: Received in-only message.
[java] 03-Dec-2008 17:17:18 com.sun.jbi.jdbcbc.InboundMessageProcessor proc
essInOnly
[java] SEVERE: Unexpected exception Occured while processing the MEP.
[java] javax.jbi.messaging.MessagingException: Error occured while executin
g sql.
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObjec
t(InboundMessageProcessor.java:515)
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.processInOnly(Inbo
undMessageProcessor.java:343)
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.execute(InboundMes
sageProcessor.java:277)
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.run(InboundMessage
Processor.java:207)
[java] at java.lang.Thread.run(Thread.java:619)
[java] Caused by: java.sql.SQLException: socket creation error
[java] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
[java] at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcDataSource.getConnection(Unknown Source)
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDatabaseConnect
ion(InboundMessageProcessor.java:829)
[java] at com.sun.jbi.jdbcbc.InboundMessageProcessor.getDataAccessObjec
t(InboundMessageProcessor.java:463)
[java] ... 4 more
tijs.rademakers (494) [Avatar] Offline
#2
Re: Chapter 6 ServiceMix PEtALS example not working.
What you should do is undeploy the service assemblies. Start the James server by running the run.bat in the james-2.3.1in directory. Make sure that you have run the patchCore target and then start ServiceMix again. Then deploy the mail sender example and copy the test-mail file to the chapter6/4a-mail/in directory. Then you should see a message the mail has been sent. Then you can retrieve this mail with the 4b-mail receiver example.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#3
Re: Chapter 6 ServiceMix PEtALS example not working.
Tjis,

I ran the gn:patchSMCore target as instructed on page 228, with the following result:

C:osesbinactionworkspaceworkspace-servicemixservicemix esourceschapter6>an
t -f ch6-build.xml gn:patchSMCore
Buildfile: ch6-build.xml

gn:patchSMCore:
[mkdir] Created dir: C:osesbinactionoxResourcesservicemix-core-3.2.1
[copy] Copying 1 file to C:osesbinactionesbapache-servicemix-3.2.1lib
[copy] Copying 1 file to C:osesbinactionoxResources
[unzip] Expanding: C:osesbinactionoxResourcesservicemix-core-3.2.1.jar i
nto C:osesbinactionoxResourcesservicemix-core-3.2.1

BUILD FAILED
C:osesbinactionworkspaceworkspace-servicemixservicemix esourceschapter6ch
6-build.xml:191: Warning: Could not find file C:osesbinactionworkspaceworkspa
ce-servicemixservicemixclasses-overrideorgapacheservicemixjbideploymentD
escriptorFactory.class to copy.

Total time: 1 second
C:osesbinactionworkspaceworkspace-servicemixservicemix esourceschapter6>

It comes as no surprise, because when I looked at the class-generated directory there was nothing in it. The source is there for the class file, so it appears that it't not getting compiled and deployed. Is there another target which does this?
Don Stadler (74) [Avatar] Offline
#4
This is still failing in the new environment
see the post above for symptoms.
tijs.rademakers (494) [Avatar] Offline
#5
Re: This is still failing in the new environment
This problem is also related to the fact that we always have used Eclipse to work with the examples. In the Ant build script there was no target to compile the src-generated and src-override sources. I added a target in the scripts/ant/sm-general directory named gn:compileExtraClasses which does the trick. So run this target before you proceed with the examples and then you should be good to go. Note that you''ll have to do a svn update from the Google code repository to get the new sources. You can also download the new version of the sm-general.xml file from the Google code website at http://code.google.com/p/esbinaction-servicemix/source/browse/trunk/servicemix/scripts/ant/sm-general.xml.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#6
SVN checkout
To do the SVN checkout I added two targets back into the osesbinaction build.xml file, get-servicemix-code and get-mule-code. These were shamelessly stolen from an old version of the build.xml file. The two targets are defined below, and require that the svn library be instlled first (i.e. the main install must be complete before doing this). I ran the get-servicemix-code target against the build and it retrieved the new version of the file Tjis mentions above.

<target name="get-servicemix-code" depends="init" description="Download the source code for servicemix from subversion">
<echo message="Checking out latest servicemix code from SVN" />

<path id="svnkit">
<fileset dir="${install.target.libraries}/${download.svnkit.archive.dir}">
<include name="svnkit.jar" />
<include name="svnkit-cli.jar" />
</fileset>
</path>

<java classname="org.tmatesoft.svn.cli.SVN" dir="${install.target.workspace.servicemix}" fork="true">
<arg value="-v" />
<arg value="co" />
<arg value="${svn.servicemix}/" />
<classpath refid="svnkit" />
</java>

</target>
<target name="get-mule-code" depends="init" description="Download the source code for mule from subversion">
<echo message="Checking out latest mule code from SVN" />

<path id="svnkit">
<fileset dir="${install.target.libraries}/${download.svnkit.archive.dir}">
<include name="svnkit.jar" />
<include name="svnkit-cli.jar" />
</fileset>
</path>

<java classname="org.tmatesoft.svn.cli.SVN" dir="${install.target.workspace.mule}" fork="true">
<arg value="-v" />
<arg value="co" />
<arg value="${svn.mule}/" />
<classpath refid="svnkit" />
</java>

</target>
Don Stadler (74) [Avatar] Offline
#7
Corrupt PEtALs zip file?
Tjis,

When installing the PEtALs zip file as per step 8 on page 228, I got the following in the Servicemix trace:

[java] WARN - AutoDeploymentService - Directory: hotdeploy: Auto
atic install of C:osesbinactionesbapache-servicemix-3.2.1hotdeploypetals-b
-mail-3.0-beta1.zip failed
[java] javax.jbi.management.DeploymentException: <?xml version="1.0" encod <br /> ng="UTF-8"?>
[java] <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message" >
version="1.0">
[java] <jbi-task-result>
[java] <frmwk-task-result>
[java] <frmwk-task-result-details>
[java] <task-result-details>
[java] <task-id>deploy</task-id>
[java] <task-result>FAILED</task-result>
[java] <message-type>ERROR</message-type>
[java] <task-status-msg>
[java] <msg-loc-info>
[java] <loc-token/>
[java] <loc-message>Unable to unpack archive: C:osesbinactionesbapache-
ervicemix-3.2.1hotdeploypetals-bc-mail-3.0-beta1.zip</loc-message>
[java] </msg-loc-info>
[java] </task-status-msg>
[java] <exception-info>
[java] <nesting-level>1</nesting-level>
[java] <loc-token/>
[java] <loc-message>java.io.FileNotFoundException: C:osesbinactionesbap
che-servicemix-3.2.1hotdeploypetals-bc-mail-3.0-beta1.zip (The process cannot
access the file because it is being used by another process)</loc-message>
[java] <stack-trace><![CDATA[javax.jbi.management.DeploymentException: jav >
.io.FileNotFoundException: C:osesbinactionesbapache-servicemix-3.2.1hotdepl
ypetals-bc-mail-3.0-beta1.zip (The process cannot access the file because it i
being used by another process)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.un
ackLocation(AutoDeploymentService.java:595)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.up
ateArchive(AutoDeploymentService.java:22smilie
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.mo
itorDirectory(AutoDeploymentService.java:647)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.ac
ess$800(AutoDeploymentService.java:60)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.
un(AutoDeploymentService.java:611)
[java] at java.util.TimerThread.mainLoop(Timer.java:512)
[java] at java.util.TimerThread.run(Timer.java:462)
[java] Caused by: java.io.FileNotFoundException: C:osesbinactionesbapac
e-servicemix-3.2.1hotdeploypetals-bc-mail-3.0-beta1.zip (The process cannot a
cess the file because it is being used by another process)
[java] at java.util.zip.ZipFile.open(Native Method)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[java] at org.apache.servicemix.jbi.util.FileUtil.archiveContainsEntry
FileUtil.java:174)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.un
ackLocation(AutoDeploymentService.java:587)
[java] ... 6 more
[java] ]]></stack-trace>
[java] </exception-info>
[java] </task-result-details>
[java] </frmwk-task-result-details>
[java] </frmwk-task-result>
[java] </jbi-task-result>
[java] </jbi-task>
[java]
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.fa
lure(AutoDeploymentService.java:384)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.fa
lure(AutoDeploymentService.java:374)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.up
ateArchive(AutoDeploymentService.java:230)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.mo
itorDirectory(AutoDeploymentService.java:647)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService.ac
ess$800(AutoDeploymentService.java:60)
[java] at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.
un(AutoDeploymentService.java:611)
[java] at java.util.TimerThread.mainLoop(Timer.java:512)
[java] at java.util.TimerThread.run(Timer.java:462)
tijs.rademakers (494) [Avatar] Offline
#8
Re: Corrupt PEtALs zip file?
Don,

This is not something you would expect. But please try to uninstall the Petals JBI component and delete the data directory. Then start ServiceMix again and when it's started try to copy the zip file again. No better solution, sorry.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#9
Installing PEtALs in Servicemix - this way lies madness?
Tjis,

My experience thus far with the PEtALs example is that not only doesn't it work, but it corrupts my servicemix instance beyond hope of redemption every time I try to do it, forcing yet another rebuild of the entire osesbinaction environment.

I just ran it again, and servicemix choked on the mail compenent installed by deploy-4a-mail-sender. So I removed the mail-sender and the PETALs file and the data directory, and restarted servicemix, with the result of an endless exception being thrown from attempting to install servicemix-wsn2005.

So, yes, I agree that interoperability between JBI's built for different platforms my INDEED appear to be a great idea but not quite there in implementation as yet.

Do it only with great trepidation and making a good backup, or risk losing your servicemix deployment to endless woes.