You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by peppinolusuraio <ua...@libero.it> on 2009/02/11 16:01:24 UTC

classpath problems

I'm using SMIX 3.2.3 and I'm encoutering big big classpath problems in my
CXF-SE service unit.
I'm migrating the application to SMIX from CXF standalone, and the
application on CXF is well functioning.
I'm not able to load resources on the classpath while deploying to service
mix.
My SU has a default maven structure.

I used workarounds these problems, using absolute URL, but I can't go on
this way.

first case

I have some resources, for example properties and xml file under a certain
package.

for example I have:

src/main/java/com/my/fuffa/file.properties

On the xbean xml it is used in the bean using this file as a URL, so at
first I create a URL.

<bean id="internal_2_tmf854_rules" class="java.net.URL">
     <constructor-arg>
	 <value>file:com/my/fuffa/file.properties</value>
    </constructor-arg>
</bean>

Creating a test beans.xml the URL are relolved and these file are loaded in
the right way (I transform the SU in a eclipse project).
When I deploy inside SMIX the URL are not resolved anymore and the file get
lot loaded.
What is the correct URL format for a resource as a class file, or something
inside servicemix as i have described?

before migrating every time I codes something as: 
URL url = new URL("com/fuffa/file.properties");
worked fine, now it does not anymore.

second case
the same applies for the handler chain file, annotated as:
@HandlerChain(file="com/my/company/handlers.xml")

In standalone CXF it worked, while not it does not work anymore. 

questions
Where could be my problems? 
How could I work around these without absolute urls?
I fear there's something to do with ClassLoader mechanism, but I can't
figure out what's going on.















-- 
View this message in context: http://www.nabble.com/classpath-problems-tp21956791p21956791.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: classpath problems

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

You should use the src/main/resources directory for non-java-source
files (like e.g. properties files). Eclipse knows how to deal with
properties files in the java source directory, but Maven expects them
to be in this separate directory when it creates the SU for deployment
on ServiceMix.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/2/11 peppinolusuraio <ua...@libero.it>:
>
> I'm using SMIX 3.2.3 and I'm encoutering big big classpath problems in my
> CXF-SE service unit.
> I'm migrating the application to SMIX from CXF standalone, and the
> application on CXF is well functioning.
> I'm not able to load resources on the classpath while deploying to service
> mix.
> My SU has a default maven structure.
>
> I used workarounds these problems, using absolute URL, but I can't go on
> this way.
>
> first case
>
> I have some resources, for example properties and xml file under a certain
> package.
>
> for example I have:
>
> src/main/java/com/my/fuffa/file.properties
>
> On the xbean xml it is used in the bean using this file as a URL, so at
> first I create a URL.
>
> <bean id="internal_2_tmf854_rules" class="java.net.URL">
>     <constructor-arg>
>         <value>file:com/my/fuffa/file.properties</value>
>    </constructor-arg>
> </bean>
>
> Creating a test beans.xml the URL are relolved and these file are loaded in
> the right way (I transform the SU in a eclipse project).
> When I deploy inside SMIX the URL are not resolved anymore and the file get
> lot loaded.
> What is the correct URL format for a resource as a class file, or something
> inside servicemix as i have described?
>
> before migrating every time I codes something as:
> URL url = new URL("com/fuffa/file.properties");
> worked fine, now it does not anymore.
>
> second case
> the same applies for the handler chain file, annotated as:
> @HandlerChain(file="com/my/company/handlers.xml")
>
> In standalone CXF it worked, while not it does not work anymore.
>
> questions
> Where could be my problems?
> How could I work around these without absolute urls?
> I fear there's something to do with ClassLoader mechanism, but I can't
> figure out what's going on.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/classpath-problems-tp21956791p21956791.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>