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
The servicemix project seems to be missing several jar files needed to compile the zip file it is trying to deploy. It could not find javax.xml.ws.Endpoint. Looking at the servicemix project properties Java Build Path I noticed that there seemed to be a bad wsdl4j jar file. Mule had a good copy so I copied it into the servicemixlib directory. But several other packages do not seem to exist:

[javac] C:osesbinactionworkspaceworkspace-servicemixservicemixsrcesbc
pter7ChamberOfCommerceServiceImpl.java:5: package javax.jws does not exist
[javac] import javax.jws.WebService;
[javac] ^
[javac] C:osesbinactionworkspaceworkspace-servicemixservicemixsrcesbc
pter7TestPwdCallback.java:11: package org.apache.ws.security does not exist
[javac] import org.apache.ws.security.WSPasswordCallback;
[javac] ^

The org.apache.ws.security package was in wss4j-1.5.4.jar, and I found a copy of it in the CXF lib directory and copied the jar into C:osesbinactionesbapache-servicemix-3.2.1work-esb-inactionlib.

Package javax.jws was harder to find, but copying xfire-jsr181-api-1.0-M1.jar from C:osesbinactionesbapache-servicemix-3.2.1datasmxcomponentsservicemix-jsr181version_1lib into C:osesbinactionesbapache-servicemix-3.2.1work-esb-inactionlib solved it.

Then on to the next batch of compile errors, basically endless 'cannot find x common class errors', which translates into 'missing jar on classpath'. Solved this by finding jaxws-api-2.0.jar from mule and copied it into C:osesbinactionesbapache-servicemix-3.2.1work-esb-inactionlib.

All of these jar files had copies buried deep inside apache-servicemix-3.2.1, but the classpath could not access them.
Don Stadler (74) [Avatar] Offline
#2
Re: Chapter 7 Environmental problems for Servicemix
Tjis,

Would you do me a favor and test the new environment against all of the chapter examples, at least beginning with the chapter 7 examples? Today I thought I'd be finished with Chapter 8, but instead it;'s fix one problem after another.

I still cannot run a single Chapter 7 example. Servicemix is not starting, throwing a:

[java] java.io.EOFException
[java] at java.io.DataInputStream.readInt(DataInputStream.java:35smilie
[java] at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWir
eFormat.java:267)
[java] at org.apache.activemq.transport.tcp.TcpTransport.readCommand(Tc
pTransport.java:156)
[java] at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTranspo
rt.java:136)
[java] at java.lang.Thread.run(Thread.java:595)
[java] Caught: org.springframework.beans.factory.BeanCreationException: Err
or creating bean with name 'jbi' defined in file [C:osesbinactionesbapache-se
rvicemix-3.2.1confservicemix.xml]: Invocation of init method failed; nested ex
ception is java.lang.UnsupportedClassVersionError: Bad version number in .class
file
[java] org.springframework.beans.factory.BeanCreationException: Error creat
ing bean with name 'jbi' defined in file [C:osesbinactionesbapache-servicemix
-3.2.1confservicemix.xml]: Invocation of init method failed; nested exception
is java.lang.UnsupportedClassVersionError: Bad version number in .class file
[java] Caused by: java.lang.UnsupportedClassVersionError: Bad version numbe
r in .class file
[java] at java.lang.ClassLoader.defineClass1(Native Method)
[java] at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
[java] at java.security.SecureClassLoader.defineClass(SecureClassLoader
.java:124)
[java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
[java] at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:18smilie
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[java] at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(Rea
lmClassLoader.java:195)
[java] at org.codehaus.classworlds.DefaultClassRealm.loadClassDirect(De
faultClassRealm.java:412)
[java] at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultC
lassRealm.java:376)
[java] at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClas
sLoader.java:214)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

[java] at org.apache.servicemix.jbi.framework.InstallationService.build
SharedLibs(InstallationService.java:492)
[java] at org.apache.servicemix.jbi.framework.InstallationService.build
State(InstallationService.java:462)
[java] at org.apache.servicemix.jbi.framework.InstallationService.init(
InstallationService.java:260)
[java] at org.apache.servicemix.jbi.container.JBIContainer.init(JBICont
ainer.java:595)
[java] at org.apache.servicemix.jbi.container.SpringJBIContainer.afterP
ropertiesSet(SpringJBIContainer.java:66)
[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:585)
[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)

Looks liek an ActiveMQ startup problem, but I'm too fried to go solve that one.
tijs.rademakers (494) [Avatar] Offline
#3
Re: Chapter 7 Environmental problems for Servicemix
Don,

For the ServiceMix examples, I'm able to run them without any changes. Please make sure that you don't copy any jars from Mule to ServiceMix. Just use the plain ServiceMix installation. Again the web service generated source are already part of the ServiceMix source distribution, so you don't have to generate them again. Then just run the deploy-* targets to deploy the examples.

For the other chapters, they should run smoothly. So hope you don't run into issues there.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#4
Similar error to post #1
Tjis,

It looks like the "package org.apache.ws.security does not exist" error is retained in the new environment.

You mentioned under the chapter 7 mule comment that the bouncycastle jar was needed for Mule ws-security to work. Is this related? If so where do I put the bouncycastle jars, and which jar unless you want me to deply all of them?

gn:create-serviceunit:
[echo] Preparing service unit creation
[mkdir] Created dir: C:osesbinactionworkspaceworkspace-servicemixservice
mixworkSU-WSDL-TOP-DOWN-CXF-SE.zip.work
[mkdir] Created dir: C:osesbinactionworkspaceworkspace-servicemixservice
mixworkSU-WSDL-TOP-DOWN-CXF-SE.zip.workMETA-INF
[echo] No resource directory specified
[echo] Including classes into Service unit
[echo] compiling classes from esb/chapter7/**/*
[javac] Compiling 7 source files to C:osesbinactionworkspaceworkspace-ser
vicemixservicemixclasses
[javac] C:osesbinactionworkspaceworkspace-servicemixservicemixsrcesbc
hapter7TestPwdCallback.java:11: package org.apache.ws.security does not exist
[javac] import org.apache.ws.security.WSPasswordCallback;
[javac] ^
[javac] C:osesbinactionworkspaceworkspace-servicemixservicemixsrcesbc
hapter7TestPwdCallback.java:25: cannot find symbol
[javac] symbol : class WSPasswordCallback
[javac] location: class esb.chapter7.TestPwdCallback
[javac] WSPasswordCallback pc = (WSPasswordCallback) cal
lbacks[i];
[javac] ^
[javac] C:osesbinactionworkspaceworkspace-servicemixservicemixsrcesbc
hapter7TestPwdCallback.java:25: cannot find symbol
[javac] symbol : class WSPasswordCallback
[javac] location: class esb.chapter7.TestPwdCallback
[javac] WSPasswordCallback pc = (WSPasswordCallback) cal
lbacks[i];
[javac] ^
[javac] Note: C:osesbinactionworkspaceworkspace-servicemixservicemixsrc
esbchapter7TestPwdCallback.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errors
Don Stadler (74) [Avatar] Offline
#5
Do the stub files have to ba hacked for Servicemix?
I noticed that the Servicemix example generates the stubs same as the Mule example does. You mention it on page 256. What you don't mention is whether the CoCPortTypeImpl class must be changed to support the delegate as it was in the Mule example.

Should I do the same thing?
tijs.rademakers (494) [Avatar] Offline
#6
Re: Do the stub files have to ba hacked for Servicemix?
I'm always running the Ant scripts from Eclipse and it's working fine there, so that's why I didn't notice this yet. The problem is the wss4j library version in the scripts/ant/sm-general.xml file. It is wss4j-1.5.1.jar there and this should be wss4j-1.5.4.jar. If you change this it should work just fine and you won't need additional jars. I also committed a patch for this in Google code, so you can also do a svn update.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#7
Test client gives no out response for servicemix
The the deployment of deploy-wsdl-top-down gave a compile error because of a missing delegate. I used the same implementation of the CoCPortTypeImpl class as I created a week ago for Mule, copying it over the generated version.

The deployment seemed to work except one INFO message which seemed to indicate something was wrong:

[java] INFO: Creating Service {http://opensource.esb.org/CoC/}CoCService fr
om class org.esb.opensource.coc.CoCPortTypeImpl
[java] 13-Dec-2008 20:59:30 org.apache.cxf.configuration.spring.ConfigurerI
mpl getBeanName
[java] INFO: Could not determine bean name for instance of class org.apache
.cxf.transport.jbi.JBIDestination.

[java] INFO - AutoDeploymentService - Directory: hotdeploy: Finis
hed installation of archive: SA-WSDL-TOP-DOWN.zip


I then tried to run the web service in the test client, but nothing appeared in the out box of the test client. The trace from the test client looks as follows:


C:osesbinactionosesb-test-client>java -jar osesb-test-client.jar
13-Dec-2008 21:01:20 osesbtestclient.OsesbtestclientView closeAllConnections
INFO: Switching example, closing all active listeners
message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelo <br /> e/" xmlns:coc="http://opensource.esb.org/CoC/">
<soapenv:Header/>
<soapenv:Body>
<coc:getCompany>
<companyName>Holthouse Carlin & Van Tright LLP (HCVT)</companyName >

</coc:getCompany>
</soapenv:Body>
</soapenv:Envelope>
message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelo <br /> e/" xmlns:coc="http://opensource.esb.org/CoC/">
<soapenv:Header/>
<soapenv:Body>
<coc:getCompany>
<companyName>Holthouse Carlin & Van Tright LLP (HCVT)</companyName >

</coc:getCompany>
</soapenv:Body>
</soapenv:Envelope>
message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelo <br /> e/" xmlns:coc="http://opensource.esb.org/CoC/">
<soapenv:Header/>
<soapenv:Body>
<coc:getCompany>
<companyName>Holthouse Carlin & Van Tright LLP (HCVT)</companyName >

</coc:getCompany>
</soapenv:Body>
</soapenv:Envelope>
message <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelo <br /> e/" xmlns:coc="http://opensource.esb.org/CoC/">
<soapenv:Header/>
<soapenv:Body>
<coc:getCompany>
<companyName>Holthouse Carlin & Van Tright LLP (HCVT)</companyName >

</coc:getCompany>
</soapenv:Body>
</soapenv:Envelope>

Full trace below:

C:osesbinactionworkspaceworkspace-servicemixservicemix esourceschapter7>an
t -f ch7-build.xml start
Buildfile: ch7-build.xml

init:

gn:init:
[echo] Chapter home is set to C:osesbinactionworkspaceworkspace-servicem
ixservicemix esourceschapter7.
[echo] Workspace home is set to C:osesbinactionworkspaceworkspace-servic
emixservicemix.

start:
[echo] Starting Servicemix: use CTRL-C or kill the process to stop the serv
er

gn:start:
[java] Listening for transport dt_socket at address: 8000
[java] Starting Apache ServiceMix ESB: null
[java]
[java] Loading Apache ServiceMix from file: conf/servicemix.xml
[java] INFO - ConnectorServerFactoryBean - JMX connector available at:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
[java] INFO - JBIContainer - ServiceMix null JBI Contain
er (ServiceMix) is starting
[java] INFO - JBIContainer - For help or more informatio
ns please see: http://incubator.apache.org/servicemix/
[java] INFO - ComponentMBeanImpl - Initializing component: #Su
bscriptionManager#
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] INFO - jetty - Logging to org.apache.servi
cemix.http.jetty.JCLLogger@10e3a00 via org.apache.servicemix.http.jetty.JCLLogge
r
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] overridden version used
[java] INFO - DeploymentService - Restoring service assemblie
s
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-bean to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-bean
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-camel to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-camel
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-cxf-bc to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-cxf-bc
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-cxf-se to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-cxf-se
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-drools to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-drools
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-eip to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-eip
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-file to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-file
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-ftp to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-ftp
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-http to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-http
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-jms to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-jms
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-jsr181 to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-jsr181
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-lwcontainer to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-lwcontainer
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-quartz to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-quartz
[java] 1 name = quartz.properties
[java] INFO - SimpleThreadPool - Job execution threads will
use class loader of thread: main
[java] INFO - QuartzScheduler - Quartz Scheduler v.1.5.2 cr
eated.
[java] INFO - RAMJobStore - RAMJobStore initialized.
[java] INFO - StdSchedulerFactory - Quartz scheduler 'DefaultQu
artzScheduler' initialized from default resource file in Quartz package: 'quartz
.properties'
[java] INFO - StdSchedulerFactory - Quartz scheduler version: 1
.5.2
[java] INFO - QuartzScheduler - Scheduler DefaultQuartzSche
duler_$_NON_CLUSTERED started.
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-saxon to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-saxon
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-script to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-script
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-truezip to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-truezip
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-wsn2005 to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-wsn2005
[java] INFO - ComponentMBeanImpl - Setting running state for C
omponent: servicemix-xmpp to Started
[java] INFO - ComponentMBeanImpl - Initializing component: ser
vicemix-xmpp
[java] INFO - JBIContainer - ServiceMix JBI Container (S
erviceMix) started
[java] INFO - JDBCAdapterFactory - Database driver recognized:
[apache_derby_embedded_jdbc_driver]
[java] INFO - AutoDeploymentService - Directory: hotdeploy: Archi
ve changed: processing SA-WSDL-TOP-DOWN.zip ...
[java] INFO - ServiceAssemblyLifeCycle - Starting service assembly:
Chapter7-WSDL-TOP-DOWN
[java] INFO - ServiceUnitLifeCycle - Initializing service unit:
SU-WSDL-TOP-DOWN
[java] INFO - ServiceUnitLifeCycle - Initializing service unit:
SU-WSDL-TOP-DOWN-CXF-SE
[java] INFO - ServiceUnitLifeCycle - Starting service unit: SU-W
SDL-TOP-DOWN
[java] 13-Dec-2008 20:59:27 sun.reflect.NativeMethodAccessorImpl invoke0
[java] INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log)
via org.mortbay.log.Slf4jLog
[java] 13-Dec-2008 20:59:27 sun.reflect.NativeMethodAccessorImpl invoke0
[java] INFO: jetty-6.1.5
[java] 13-Dec-2008 20:59:28 sun.reflect.NativeMethodAccessorImpl invoke0
[java] INFO: Started SelectChannelConnector@0.0.0.0:8080
[java] INFO - ServiceUnitLifeCycle - Starting service unit: SU-W
SDL-TOP-DOWN-CXF-SE
[java] 13-Dec-2008 20:59:28 org.apache.cxf.service.factory.ReflectionServic
eFactoryBean buildServiceFromClass
[java] INFO: Creating Service {http://opensource.esb.org/CoC/}CoCService fr
om class org.esb.opensource.coc.CoCPortTypeImpl
[java] 13-Dec-2008 20:59:30 org.apache.cxf.configuration.spring.ConfigurerI
mpl getBeanName
[java] INFO: Could not determine bean name for instance of class org.apache
.cxf.transport.jbi.JBIDestination.
[java] INFO - AutoDeploymentService - Directory: hotdeploy: Finis
hed installation of archive: SA-WSDL-TOP-DOWN.zip
[java] 13-Dec-2008 21:01:47 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
[java] 13-Dec-2008 21:01:47 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
[java] 13-Dec-2008 21:01:48 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
[java] 13-Dec-2008 21:01:48 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
[java] 13-Dec-2008 21:02:07 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
[java] 13-Dec-2008 21:02:08 org.apache.cxf.transport.jbi.JBITransportFactor
y setDeliveryChannel
[java] INFO: configuring DeliveryChannel: org.apache.servicemix.common.End
pointDeliveryChannel@79c647
tijs.rademakers (494) [Avatar] Offline
#8
Re: Test client gives no out response for servicemix
Just like the Mule example, I think the example has executed without errors. The output of the web service is shown in a second box that's part of the input part of the Swing test client. That should do the trick. Excuse us for the confusion, we aren't Swing experts so we had to implement some hacks.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#9
Top-down & bottom-up both worked.
As heading