You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by nvijayak <nv...@cs.indiana.edu> on 2008/02/06 20:39:09 UTC

classpath question

Hi,

I have the following directory structure for a JSR181 project:

apache-servicemix-3.2.1/examples/Calculator 
apache-servicemix-3.2.1/examples/Calculator/calc-http-su
apache-servicemix-3.2.1/examples/Calculator/calc-jsr181-su
apache-servicemix-3.2.1/examples/Calculator/calc-sa

In my JSR181-su I need to use a jar file. In the
calc-jsr181-su/src/main/resources/xbean.xml, I have added the following

<classpath><location>foo.jar</location></classpath>

Where do I place this foo.jar so that it get embeeded inside the SU? I tried
placing it in Calculator, calculator-jsr181-su directories and it still
complains of ClassNotFound

Could someone please tell me where the jar needs to be placed in the
directory structure?

Thanks,
Nithya
-- 
View this message in context: http://www.nabble.com/classpath-question-tp15312251s12049p15312251.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: classpath question

Posted by nvijayak <nv...@cs.indiana.edu>.
finally figured out. The problem was in making maven realize my repository

set environment variable M2_REPO to point to USERHOME\.m2\repository. For
example C:\Documents and Settings\nvijayak\.m2\repository

Then use mvn install-file goal to register a new jar to the repository using
the following command. It also creates the pom file.mvn install:install-file
-Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id>
-Dversion=<version> -Dpackaging=<packaging>
ex: The following command installs a crsws-sa-1.0-SNAPSHOT.jar in the
repository and creates a pom
mvn install:install-file
-Dfile=..\examples\crsws\crsws-sa\target\crsws-sa-1.0-SNAPSHOT.jar
-DgroupId=org.apache.servicemix.examples.crsws -Dversion=1.0-SNAPSHOT
-Dpackaging=jar -DartifactId=crsws-sa -DgeneratePom=true
 
Use the following as dependency in the service-unit/assembly as needed.
<dependency>
<groupId>org.apache.servicemix.examples.crsws</groupId>
<artifactId>crsws-sa</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

Nithya



Gert Vanthienen wrote:
> 
> Nithya,
> 
> You don't have to specify the <classpath/> in your xbean.xml since 
> ServiceMix 3.1 (cfr. http://servicemix.apache.org/classloaders.html) you 
> put the JAR file in the lib/ folder in your SU.  Even better, if you are 
> using the Maven JBI plugin, you can simply add a dependency to the 
> JSR-181 project's pom.xml to get the JAR file in the SU automatically.
> 
> Gert
> 
> nvijayak wrote:
>> Hi,
>>
>> I have the following directory structure for a JSR181 project:
>>
>> apache-servicemix-3.2.1/examples/Calculator 
>> apache-servicemix-3.2.1/examples/Calculator/calc-http-su
>> apache-servicemix-3.2.1/examples/Calculator/calc-jsr181-su
>> apache-servicemix-3.2.1/examples/Calculator/calc-sa
>>
>> In my JSR181-su I need to use a jar file. In the
>> calc-jsr181-su/src/main/resources/xbean.xml, I have added the following
>>
>> <classpath><location>foo.jar</location></classpath>
>>
>> Where do I place this foo.jar so that it get embeeded inside the SU? I
>> tried
>> placing it in Calculator, calculator-jsr181-su directories and it still
>> complains of ClassNotFound
>>
>> Could someone please tell me where the jar needs to be placed in the
>> directory structure?
>>
>> Thanks,
>> Nithya
>>   
> 
> 
> 
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
> 

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


Re: classpath question

Posted by Gert Vanthienen <ge...@skynet.be>.
Nithya,

You don't have to specify the <classpath/> in your xbean.xml since 
ServiceMix 3.1 (cfr. http://servicemix.apache.org/classloaders.html) you 
put the JAR file in the lib/ folder in your SU.  Even better, if you are 
using the Maven JBI plugin, you can simply add a dependency to the 
JSR-181 project's pom.xml to get the JAR file in the SU automatically.

Gert

nvijayak wrote:
> Hi,
>
> I have the following directory structure for a JSR181 project:
>
> apache-servicemix-3.2.1/examples/Calculator 
> apache-servicemix-3.2.1/examples/Calculator/calc-http-su
> apache-servicemix-3.2.1/examples/Calculator/calc-jsr181-su
> apache-servicemix-3.2.1/examples/Calculator/calc-sa
>
> In my JSR181-su I need to use a jar file. In the
> calc-jsr181-su/src/main/resources/xbean.xml, I have added the following
>
> <classpath><location>foo.jar</location></classpath>
>
> Where do I place this foo.jar so that it get embeeded inside the SU? I tried
> placing it in Calculator, calculator-jsr181-su directories and it still
> complains of ClassNotFound
>
> Could someone please tell me where the jar needs to be placed in the
> directory structure?
>
> Thanks,
> Nithya
>