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
I followed the instructions on page 201, starting servicemix, deploying the service with ant -f ch6-example.xml deploy-1a-file-example, which servicemix hotdeployed.

I copied the 1a-input.txt file into chaper61a-filein directory. Nothing happened.

Looking further I saw the filter requires the filename to be prefixed with 'deploy_me', so I renamed the file to 'deploy_me_1a.txt', then copied the file into in.

Servicemix then threw the following exception:

[java] ERROR - FileComponent - Failed to process file: cha
pter61a-fileindeploy_me_1a.txt. Reason: java.lang.NullPointerException
[java] java.lang.NullPointerException
[java] at org.apache.servicemix.file.FileSenderEndpoint.processInOnly(F
ileSenderEndpoint.java:95)
[java] at org.apache.servicemix.common.endpoints.ProviderEndpoint.proce
ss(ProviderEndpoint.java:100)
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(Asy
ncBaseLifeCycle.java:53smilie
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchan
ge(AsyncBaseLifeCycle.java:490)
[java] at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
BaseLifeCycle.java:46)
[java] at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proce
ssInBound(DeliveryChannelImpl.java:610)
[java] at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abs
tractFlow.java:170)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(Se
daFlow.java:167)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQ
ueue.java:134)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
PoolExecutor.java:885)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:907)
[java] at java.lang.Thread.run(Thread.java:619)
Don Stadler (74) [Avatar] Offline
#2
Chapter 6 Servicemix 1b does nothing
On page 206 I followed the instructions, deploying the deploy-1b-file-binary-example apparently successfully. I copied front.jpg into the chapter61bin directory, and nothing happened.
Don Stadler (74) [Avatar] Offline
#3
Re: Chapter 6 Servicemix 1b does nothing
I checked back & the jpg file had moved to the out box, so I ran the test again and it ran. It takes a while to run.

I checked test 1a again to see if it is working now,but it is still throwing the NullPointerException each time it polls.
tijs.rademakers (494) [Avatar] Offline
#4
Re: Chapter 6 Servicemix 1b does nothing
I just checked with the 1a example of chapter 6. There's a deploy_me-test.xml test file that you can you use to copy to the chapter6/1a-file/in directory. This works fine in my environment. Which file did you use to test? Make sure it's a XML file.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#5
Re: Chapter 6 Servicemix 1b does nothing
I used the .txt file, so that could explain it. I'll go back and try it.
Don Stadler (74) [Avatar] Offline
#6
Re: Chapter 6 Servicemix 1b does nothing
It appears that my efforts with Chapter 7 last week corrupted my servicemix deployment. I undeployed everything but the core stuff in the hotdeploy directory and am still getting nasty exceptions thrown. Next step appears to be to redo the entire environment - again. Unless the following makes more sense to you than to me?

[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)
[java] ERROR - ActiveMQEndpointWorker - Endpoint connection to JMS
broker failed: Could not connect to broker URL: tcp://localhost:61616. Reason: j
ava.net.ConnectException: Connection refused: connect
[java] ERROR - ActiveMQEndpointWorker - Endpoint will try to reconn
ect to the JMS broker in 30 seconds
Terminate batch job (Y/N)? y
Don Stadler (74) [Avatar] Offline
#7
Chapter 6 Servicemix 1a throws exception resolved
Tjis,

This test worked with the new environment.