Re: Standard Webapp unable to locate blueprint .xml

2017-04-30 Thread Achim Nierbeck
Either way is fine with samples.
I'm not sure we have enough web samples in Karaf,
usually all samples are directed to Pax-Web as it's the actual
implementation of the Web-Container.

regards, Achim


2017-04-28 10:55 GMT+02:00 smunro :

> Ok,
>
> turns out that I was missing something rather obvious. Our pom file already
> has a copy-resources maven goal setup, which targets webapp/build
> (generated
> angular content is placed here by another plugin). So anything above this
> level was not being placed into the WAR file. I just added another
>  entry to copy /src/main/resources to copy over
> OSGI-INF/blueprint/rest.xml and everything is working as expected :)
>
> In addition, I removed the bundle activator.
>
> Thanks for helping me out with this one, sorry it turned out to be a minor
> thing, but at least I'm confident there is nothing wrong with Karaf or the
> maven plugin when using WAR types.
>
> I still think it would be good to do a simple example of the above, which
> I'm happy to do. I can either contribute that to your list of samples or
> link it to my own github.
>
> Stephen
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050278.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master


Re: Standard Webapp unable to locate blueprint .xml

2017-04-28 Thread smunro
Ok,

turns out that I was missing something rather obvious. Our pom file already
has a copy-resources maven goal setup, which targets webapp/build (generated
angular content is placed here by another plugin). So anything above this
level was not being placed into the WAR file. I just added another
 entry to copy /src/main/resources to copy over
OSGI-INF/blueprint/rest.xml and everything is working as expected :)

In addition, I removed the bundle activator.

Thanks for helping me out with this one, sorry it turned out to be a minor
thing, but at least I'm confident there is nothing wrong with Karaf or the
maven plugin when using WAR types.

I still think it would be good to do a simple example of the above, which
I'm happy to do. I can either contribute that to your list of samples or
link it to my own github.

Stephen



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050278.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Standard Webapp unable to locate blueprint .xml

2017-04-25 Thread smunro
Thanks for the links Achim :)

As mentioned previously, I tried to use the programmatic approach to
bootstrapping a CXF-JAXRS service within a bundle activator and it worked
fine.  It's not apocalyptic if I go down this road, but I'd like to have
declarative control with the address.

I think it's worth doing a project for the karaf samples that shows just
blueprint and a WAB as similar people have had problems with this.

I'll have a look at the links you provided me with to see if there is
anything different to my configuration.

Stephen  





--
View this message in context: 
http://karaf.922171.n3.nabble.com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050250.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Standard Webapp unable to locate blueprint .xml

2017-04-25 Thread Achim Nierbeck
Hi,

here's one that uses blueprint to register servlets, though no WAB [1].
another one I have using cxf rest is also a non WAB bundle [2].
For a WAB with blueprint I'd need to create a sample first. That'll take
some time though :)

regards, Achim


[1] -
https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/whiteboard-blueprint
[2] -
https://github.com/ANierbeck/Karaf-Microservices/tree/master/service-proxy

2017-04-25 13:23 GMT+02:00 smunro :

> Thanks for the swift reply and the information.
>
> Sadly, I tried as you suggested and removed the activator and it's
> definition in the maven plugin. Even after changing my type to JAR. I still
> had the missing configuration error.
>
> What I did in the past was simply created a standard OSGI bundle with no
> web
> components i.e no WEB-INF folder. This allowed my REST server to work fine,
> but I was asked to have it working with the web osgi bundle.
>
> Again, I consistently get the same "missing configuration" error. Late on,
> I'll download the karaf source and see what exactly is causing getResource
> problems.
>
> I don't suppose you know of any examples lingering around that are standard
> WAB bundles with a blueprint definition? I've had a look around, and not
> really found much. What I did find added several additional bundles
> confused
> matters further.
>
> At the moment, I'm just trying to hard code the cxf rest server in the
> activator class and register end points to see if that works, but
> personally, I'd rather have declaration control over these things hence the
> usage of blueprint.
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050248.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master


Re: Standard Webapp unable to locate blueprint .xml

2017-04-25 Thread smunro
Thanks for the swift reply and the information.

Sadly, I tried as you suggested and removed the activator and it's
definition in the maven plugin. Even after changing my type to JAR. I still
had the missing configuration error.

What I did in the past was simply created a standard OSGI bundle with no web
components i.e no WEB-INF folder. This allowed my REST server to work fine,
but I was asked to have it working with the web osgi bundle.

Again, I consistently get the same "missing configuration" error. Late on,
I'll download the karaf source and see what exactly is causing getResource
problems.

I don't suppose you know of any examples lingering around that are standard
WAB bundles with a blueprint definition? I've had a look around, and not
really found much. What I did find added several additional bundles confused
matters further.

At the moment, I'm just trying to hard code the cxf rest server in the
activator class and register end points to see if that works, but
personally, I'd rather have declaration control over these things hence the
usage of blueprint.





--
View this message in context: 
http://karaf.922171.n3.nabble.com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050248.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Standard Webapp unable to locate blueprint .xml

2017-04-25 Thread Achim Nierbeck
Hi,

I'm not sure if the blueprint extender does have an issue with WAR types,
but if changing it to JAR fixes your issue.
Then go for using JARs ;)

regards, Achim


2017-04-24 22:10 GMT+02:00 smunro :

> Looking at this further, the getResources method in the code seems unable
> to
> find a "configuration" for whatever blueprint file name I use (I've tried
> renaming the file and the error will use what ever name I give it).
>
> Is there an underlying problem with using the WAR type with blueprint or am
> I missing something in my configuration?
>
> As mentioned, I can get the cx-jaxrs code working fine in a normal JAR
> bundle, It's only when I try to integrate it into a WAR type bundle.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050240.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master


Re: Standard Webapp unable to locate blueprint .xml

2017-04-24 Thread smunro
Looking at this further, the getResources method in the code seems unable to
find a "configuration" for whatever blueprint file name I use (I've tried
renaming the file and the error will use what ever name I give it).

Is there an underlying problem with using the WAR type with blueprint or am
I missing something in my configuration?

As mentioned, I can get the cx-jaxrs code working fine in a normal JAR
bundle, It's only when I try to integrate it into a WAR type bundle.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Standard-Webapp-unable-to-locate-blueprint-xml-tp4050233p4050240.html
Sent from the Karaf - User mailing list archive at Nabble.com.