-
1. Re: Unable to include resources from src/main/resources of dependencies
davsclaus Apr 23, 2014 1:42 AM (in response to rvashishth)How do you include that other xml file from your xml file?
-
2. Re: Unable to include resources from src/main/resources of dependencies
ffang Apr 23, 2014 11:03 PM (in response to rvashishth)Also could you please post the OSGi header metadata for both Project A&B?
Freeman
-
3. Re: Unable to include resources from src/main/resources of dependencies
rvashishth Apr 24, 2014 8:45 AM (in response to davsclaus)I am using a simple spring import statement to import a xml file from other dependency jar to my bundle jar. So my first question is that, is it really possible to do so.
-
4. Re: Unable to include resources from src/main/resources of dependencies
ffang Apr 24, 2014 7:54 PM (in response to rvashishth)Hi,
It should be possible given that the Export-Package and Import-Package is correct between bundles.
I've used resources files between bundles like that, so resources files are visible across bundles.
Freeman
-
5. Re: Unable to include resources from src/main/resources of dependencies
rvashishth Apr 25, 2014 1:12 AM (in response to ffang)But i can see that export-package export only resources under src/main/java directory. In the felix plugin in configuration options i could found only <include-resource> instruction and that is for copying the resource in current bundle but there is no export-resource thing like export-package
http://fusesource.com/docs/esb/4.2/deploy_osgi/ESBMavenOSGiConfig.html#ESBMavenOSGiExport
-
6. Re: Unable to include resources from src/main/resources of dependencies
ffang Apr 25, 2014 1:26 AM (in response to rvashishth)IIRC Export-Package also works for the resource files.
That said, if you have projectA which contain
src/main/resource/x/y/z/config/SomeConfigFile.xml
then if you Export-Package x.y.z.config then this resource SomeConfigFile.xml is available outside
Then in projectB if you Import-Package x.y.z.config then you can "see" SomeConfigFile.xml in projectB
Freeman
-
7. Re: Unable to include resources from src/main/resources of dependencies
hem_jboss Apr 25, 2014 4:41 AM (in response to ffang)Hi Freeman,
I think this is not correct. I have tested it the way you described it above. But, xml / property files from src/main/resources are not copied into the target jar (project B jar).
Can you please share any sample pom files, with the help of which you are able to do so.
Regards,
Hemant
-
8. Re: Unable to include resources from src/main/resources of dependencies
ffang Apr 25, 2014 5:16 AM (in response to hem_jboss)Hi,
I'm a little bit confused,
Isn't the resource file in projectA, why you need it copied to projectB.
You export the resource from projectA, and in projectB you can import it and it's "visible" for projectB during runtime so you can use it.
Do I miss something?
Freeman
-
9. Re: Unable to include resources from src/main/resources of dependencies
hem_jboss Apr 25, 2014 6:29 AM (in response to ffang)ffang Yeah. That's the original problem here. the files under src/main/resources are not visible during runtime as well. My fuse esb container throws file not found exception.
I tried to put my config/property files under a x.y.z package in src/main/resources, but still the config files were not available during run time.
That means, only the files under src/main/java are getting exported. What i want to understand is that, is there a way i could give reference of a file(lying in resources folder in project A) in my project B? like can i write : <import resource="classpath:some-context-file.xml" /> in any spring context file in side project B.
If yes, please do share some sample pom or any link. I would really really appreciate, if you could please guide me on this.
Thanks
-
10. Re: Unable to include resources from src/main/resources of dependencies
ffang Apr 25, 2014 6:49 AM (in response to hem_jboss)Could you please append a testcase which I can build you mentioned here(projectA and projectB), I will take a close look when I get chance.
Freeman
-
11. Re: Unable to include resources from src/main/resources of dependencies
rvashishth Jun 2, 2014 7:40 AM (in response to rvashishth)Although it is surprising but i am able to import the resources if we have resource file in a standard package i.e. com.moto.flm.mapping.MyxmlMappingFile.xml
instead of having a package like x.y.z or base(src/main/resource).
-
12. Re: Unable to include resources from src/main/resources of dependencies
hem_jboss Jun 2, 2014 7:48 AM (in response to rvashishth)Yes, it worked for me as well. But, i fail to understand why fuse is not picking up files from src/main/resources folder itself.
-
13. Re: Unable to include resources from src/main/resources of dependencies
ffang Jun 2, 2014 9:31 PM (in response to rvashishth)My gut feeling is that you have multiple bundles export x.y.z package so that you run into a known "split package" issue in OSGi.
Every exported package in OSGi should be unique(version considered), so that the container would know which bundle should be wired, which classloader should be delegate, etc.
And put into base you will run into same problem, as each bundle has same base url.
Freeman