You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by shooding <sh...@gmail.com> on 2011/07/04 07:56:33 UTC

Re: ClassNotFoundException: org.apache.servicemix.MessageExchangeListener in classloader servicemix-shared

Freeman-2 wrote:
> 
> Hi,
> 
> SMX4 basically is an OSGi container, so you can't just put the 3rd  
> party lib to the lib folder, you need install it as OSGi bundle and  
> refer it from your SA.
> If your SA is OSGi packaging, you need add OSGi metadata header(Import- 
> package) for the SU.
> If your SA is JBI packaging, you can use something like
> <classpath>
>    <library>osgi:org.springframework.bean</library>
> </classpath>
> in your SU to refer a installed bundle, take a look at [1] to get more  
> details, the "New in Servicemix 4.2.0" part.
> [1]http://servicemix.apache.org/classloaders.html
> Freeman
> 

I'm developing servicemix-sip BC and have a SA using JBI packaging to start
the BC.
When try to create sip stack in sipStackImpl.java, the classloader causes
problems.
So i took your advice here to add classpath to my xbean.xml.
Before hand, i have these two jars wrapped with BND already, and put then to
deploy folder and activated successfully.

<classpath>
   <library>osgi:jain-sip-api-1.2.1</library>
   <library>osgi:jain-sip-ri-1.2.162</library>
</classpath>

But i got "Unexpected exception parsing XML document from file MYXBEAN.xml;
...nested exception is java.lang.UnsupportedOperationException: Can not
access shared libraries"

Any ideas?

-----
Industrial Technology Research Institute
Rm. 226 Bldg. 14, 2F, 195, Sec. 4, Chung Hsing Rd.,
Chutung, Hsinchu, Taiwan 31040, R.O.C.
--
View this message in context: http://servicemix.396122.n5.nabble.com/ClassNotFoundException-org-apache-servicemix-MessageExchangeListener-in-classloader-servicemix-shared-tp4481642p4549062.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ClassNotFoundException: org.apache.servicemix.MessageExchangeListener in classloader servicemix-shared

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

This exception
nested exception is
java.lang.UnsupportedOperationException: Can not access shared  
libraries at
means somehow your customer component(you mentioned you write sip  
component yourself, right?) can't determine current container is  
Smx4Container so it just use the UnknownContainer which  
getSharedLibraryClassLoader method just throw  
java.lang.UnsupportedOperationException: Can not access shared  
libraries.
You may need take a look at [1] to get more details how the container  
type get detected, you can import this code into eclipse setting  
breakpoint and start servicemix with remote debug to get more concrete  
what's wrong here.

The error should come from your component implementation,  you  
probably need check if your env use some  
javax.jbi.component.ComponentContext implementation which isn't from  
servicemix.

[1]https://svn.apache.org/repos/asf/servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/Container.java

Freeman
On 2011-7-5, at 下午4:27, shooding wrote:

> yes. I'm sure the symbolic name is correct. Checked via webconsole.
> Still got the same exception here:
>
> <loc-message>Unexpected exception parsing XML document from file
> [D:\apache-serv
> icemix-4.3.0\data\jbi\SMX4 Hello Example\sus\SU-SIP\xbean.xml]; nested
> exception is java.lang.UnsupportedOperationExcept
> ion: Can not access shared libraries</loc-message>
> <stack-trace><! 
> [CDATA[org.springframework.beans.factory.BeanDefinitionStoreExcep
> tion: Unexpected exception parsing XML document from file
> [D:\apache-servicemix-4.3.0\data\jbi\SMX4 Hello
> Example\sus\SU-SIP\xbean.xml]; nested exception is
> java.lang.UnsupportedOperationException: Can not access shared  
> libraries at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
> at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
>
> Here is my setting: referencing <a
> href="http://servicemix.apache.org/classloaders.html">http://servicemix.apache.org/classloaders.html 
> </a>
> <classpath>    	    	
>    <library>osgi:log4j-1.2.14</library>    	
>    <library>osgi:jain-sip-api-1.2.1</library>
>    <library>osgi:jain-sip-ri-1.2.162</library>
> </classpath>
>
> -----
> Industrial Technology Research Institute
> Rm. 226 Bldg. 14, 2F, 195, Sec. 4, Chung Hsing Rd.,
> Chutung, Hsinchu, Taiwan 31040, R.O.C.
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/ClassNotFoundException-org-apache-servicemix-MessageExchangeListener-in-classloader-servicemix-shared-tp4481642p4552527.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: ClassNotFoundException: org.apache.servicemix.MessageExchangeListener in classloader servicemix-shared

Posted by shooding <sh...@gmail.com>.
yes. I'm sure the symbolic name is correct. Checked via webconsole.
Still got the same exception here:

<loc-message>Unexpected exception parsing XML document from file
[D:\apache-serv
icemix-4.3.0\data\jbi\SMX4 Hello Example\sus\SU-SIP\xbean.xml]; nested
exception is java.lang.UnsupportedOperationExcept
ion: Can not access shared libraries</loc-message>
<stack-trace><![CDATA[org.springframework.beans.factory.BeanDefinitionStoreExcep
tion: Unexpected exception parsing XML document from file
[D:\apache-servicemix-4.3.0\data\jbi\SMX4 Hello
Example\sus\SU-SIP\xbean.xml]; nested exception is
java.lang.UnsupportedOperationException: Can not access shared libraries at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)

Here is my setting: referencing <a
href="http://servicemix.apache.org/classloaders.html">http://servicemix.apache.org/classloaders.html</a>
<classpath>    	    	
    <library>osgi:log4j-1.2.14</library>    	
    <library>osgi:jain-sip-api-1.2.1</library>
    <library>osgi:jain-sip-ri-1.2.162</library>
</classpath>

-----
Industrial Technology Research Institute
Rm. 226 Bldg. 14, 2F, 195, Sec. 4, Chung Hsing Rd.,
Chutung, Hsinchu, Taiwan 31040, R.O.C.
--
View this message in context: http://servicemix.396122.n5.nabble.com/ClassNotFoundException-org-apache-servicemix-MessageExchangeListener-in-classloader-servicemix-shared-tp4481642p4552527.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ClassNotFoundException: org.apache.servicemix.MessageExchangeListener in classloader servicemix-shared

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

the syntax here should be
osgi:<bundle symbolic name>
ensure you use correct Bundle-SymbolicName for your installed jain-sip  
bundle, you can use osgi:header jain-sip_bundle_id to get it.

Freeman
On 2011-7-4, at 下午1:56, shooding wrote:

>
> Freeman-2 wrote:
>>
>> Hi,
>>
>> SMX4 basically is an OSGi container, so you can't just put the 3rd
>> party lib to the lib folder, you need install it as OSGi bundle and
>> refer it from your SA.
>> If your SA is OSGi packaging, you need add OSGi metadata  
>> header(Import-
>> package) for the SU.
>> If your SA is JBI packaging, you can use something like
>> <classpath>
>>   <library>osgi:org.springframework.bean</library>
>> </classpath>
>> in your SU to refer a installed bundle, take a look at [1] to get  
>> more
>> details, the "New in Servicemix 4.2.0" part.
>> [1]http://servicemix.apache.org/classloaders.html
>> Freeman
>>
>
> I'm developing servicemix-sip BC and have a SA using JBI packaging  
> to start
> the BC.
> When try to create sip stack in sipStackImpl.java, the classloader  
> causes
> problems.
> So i took your advice here to add classpath to my xbean.xml.
> Before hand, i have these two jars wrapped with BND already, and put  
> then to
> deploy folder and activated successfully.
>
> <classpath>
>   <library>osgi:jain-sip-api-1.2.1</library>
>   <library>osgi:jain-sip-ri-1.2.162</library>
> </classpath>
>
> But i got "Unexpected exception parsing XML document from file  
> MYXBEAN.xml;
> ...nested exception is java.lang.UnsupportedOperationException: Can  
> not
> access shared libraries"
>
> Any ideas?
>
> -----
> Industrial Technology Research Institute
> Rm. 226 Bldg. 14, 2F, 195, Sec. 4, Chung Hsing Rd.,
> Chutung, Hsinchu, Taiwan 31040, R.O.C.
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/ClassNotFoundException-org-apache-servicemix-MessageExchangeListener-in-classloader-servicemix-shared-tp4481642p4549062.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com