This might get a little long but I really hope someone can help me with this.
I'm trying to add scheduling functionality to my servicemix-empowered open
source application http://www.safisystems.com SafiServer/SafiWorkshop .
I have 3 bundles involved in this use case:
com.safi.SafiServerScheduling -- Contains the Marshaler class
com.safi.SafiServer -- Contains the endpoint bean declaration which
delegates to a class extending
org.apache.servicemix.jbi.listener.MessageExchangeListener called
SafiSchedulingEndpoint:
<bean id="safiSchedulingEndpoint"
class="com.safi.server.saflet.scheduling.SafiSchedulerEndpoint" />
<bean:endpoint service="ns:safiScheduling"
endpoint="safiSchedulingEndpoint"
bean="#safiSchedulingEndpoint" />
<!-- use this special class to register the endpoints with the NMR -->
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
quartz_test2.xml -- A simple test bundle that contains a trigger and
JobDetailBean to invoke the endpoint above:
<bean name="safletInvokeJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass"
value="org.apache.servicemix.quartz.support.ServiceMixJob" />
<property name="jobDataAsMap">
<map>
<entry key="safletInvocationProperties">
<value><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM
"http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Hi</comment>
<entry key="foo">bar</entry>
<entry key="fu">baz</entry>
</properties>]]></value>
</entry>
<entry key="safletProject" value="testProject"
/>
<entry key="safletName" value="testSaflet1" />
<!-- <entry key="telephonyServerPort" value="0"
/>
<entry key="telephonyServerIp"
value="127.0.0.1" /> -->
</map>
</property>
</bean>
<bean class="com.safi.server.scheduling.SafletInvocationMarshaller"
id="marshaller" />
<quartz:endpoint service="b:service" endpoint="endpoint"
targetService="ns:safiScheduling" marshaler="#marshaller">
<quartz:trigger>
<quartz:simple repeatCount="1" repeatInterval="10000"
startDelay="2000" jobDetail="#safletInvokeJob">
</quartz:simple>
</quartz:trigger>
</quartz:endpoint>
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
When I drop the quartz_test2.xml into the deploy directory, the marshaler is
invoked correctly but a ClassNotFound exception is raised when the business
logic in the endpoint class SafiSchedulerEndpoint is invoked.
java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList not
found from bundle [com.safi.SafiServerScheduling]
at
org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
at
org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:50)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:119)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:248)
....
My class SafiSchedulerEndpoint uses many classes not exported and not
available to the bundle containing my marshaler class
(com.safi.SafiServerScheduling) including the offending
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.
However, the bundle containing the marshaler shouldn't need visibility of
those classes used internally by the endpoint and business logic
bundle(com.safi.SafiServer). The marshaler is simply taking strings from
the quartz JobExecutionContext and placing that info into properties on the
normalized message.
I chose to implement Quartz scheduling as the first (of hopefully many)
servicemix-powered features for SafiServer since I thought would be a fairly
straightfoward endeavor and immediately useful for our users. Unfortunately
it has turned into a more drawn-out battle with configuration and classpath
issues than I anticipated.
Any help on this issue is deeply appreciated.
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Classloading-problem-with-Quartz-trigger-marshaler-endpoint-tp2798721p2798721.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.