Hi, Are you using Maven to build your artifacts?
If so, then all you need to do is copy your Service Assembly Jar into the hotdeploy directory and start the servicemix server. The resources directory is automatically added to the classpath when a Maven based artifact is deployed in Servicemix. The whole point of using Maven is to avoid messing with the classpath variable. The directories that are added are the Servicemix lib directory and the artifact/src/main/resources directory Are you sure the deployment went without any errors? Also did you deploy the associated component jars in the Servicemix container. I am not able to clearly diagnose why this is happening since it is pretty basic and standard behavior in Servicemix. Just for kicks can you add the folder to the <SMX_install_dir>/lib directory and see what happens... This directory should also be on your classpath. Cheers, Ashwin... [email protected] wrote: > > Hi, > I used following code in MyBean to print CLASSPATH when the bean service > unit receiver request: > > String classpathValue = System.getProperty("java.class.path"); > System.out.println("CLASSPATH" + classpathValue); > > It seems that only the following is being added to already existing > CLASSPATH > > ;D:\installation\apache-servicemix-3.2.2\bin\..\conf;D:\installation\apache-servicemix-3.2.2\bin\..\lib\classworlds-1.0.1.jar > > What do I do to add resources to classpath ?? > > Thanks, > Harshit > > > Ashwin Karpe wrote: >> >> Hi, >> >> My sense is that the maven build did not succeed in placing an artifact >> into the Maven repository. My original answer below is correct and the >> resources directory is on the classpath since it is used in order to >> deploy the artifact into the servicemix server. >> >> BTW, did you verify that the SA does contain the SU and the artifact in >> the folder structure, I mentioned below. This could be easily verified by >> looking in the SA jar file. >> >> The correct path is with respect to the resources diectory and should be >> "./MyPropFolder/MyPropFile.txt". Please check your deployment artifact to >> see if the file has been placed in the deployable jar. >> >> Cheers, >> >> Ashwin... >> >> >> [email protected] wrote: >>> >>> Thanks for response! >>> I have tried each of the following, none of them work >>> >>> "MyPropFile.txt" >>> "MyPropFolder/MyPropFile.txt" >>> "./MyPropFolder/MyPropFile.txt" >>> "../MyPropFolder/MyPropFile.txt" >>> "./MyPropFile.txt" >>> "./resources/MyPropFolder/MyPropFile.txt" >>> "../resources/MyPropFolder/MyPropFile.txt" >>> "../../resources/MyPropFolder/MyPropFile.txt" >>> >>> Please Help! >>> >>> Regards, >>> Harshit >>> >> >> > > ----- --- Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence Progress Software Corporation 14 Oak Park Drive Bedford, MA 01730 --- +1-972-304-9084 (Office) +1-972-971-1700 (Mobile) ---- Blog: http://opensourceknowledge.blogspot.com/ -- View this message in context: http://www.nabble.com/Reading-file-with-relative-URL-from-Bean-tp21560027p21590576.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
