You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by akuhtz <an...@siemens.com> on 2011/10/26 11:24:08 UTC

Problem with starting web-app during startup

Hi,

I'm using karaf-2.2.4 and want to start a web application (with wicket) when
karaf starts. I've defined a feature that is listed under featureBoot in the
org.apache.karaf.features.cfg.
Unfortunately I get the following WARN during startup and the web app is not
started. However if I start the feature manually from the console it starts
without a problem. What am I missing? Is there anything I've to wait for? If
yes, how can I configure it?

This is my feature:
	<feature name="monitoring-server-web" version="${project.version}">
		<feature version="${apache-karaf-version}">war</feature>
		<feature version='${project.version}'>monitoring-server-core</feature>
		<bundle>mvn:org.apache.wicket/wicket/${wicket-version}</bundle>
		<bundle>mvn:org.apache.wicket/wicket-ioc/${wicket-version}</bundle>
		<bundle>mvn:org.apache.wicket/wicket-spring/${wicket-version}</bundle>
		<bundle>mvn:org.apache.wicket/wicket-extensions/${wicket-version}</bundle>
		<bundle
start-level='70'>war:mvn:com.*somepackage*.server/monitoring-server-web/${project.version}/war?Webapp-Context=web-console</bundle>
	</feature>

And this is the log from startup:

2011-10-26 11:05:14,471 DEBUG
[org.apache.karaf.features.internal.FeaturesServiceImpl] (Thread-6) Checking
war:mvn:com.*somepackage*.server/monitoring-server-web/2.0.3-SNAPSHOT/war?Webapp-Context=web-console
2011-10-26 11:05:14,471 WARN 
[org.apache.karaf.features.internal.FeaturesServiceImpl] (Thread-6) Error
when installing feature monitoring-server-web:
java.net.MalformedURLException: unknown protocol: war


Regards,
Andi


--
View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3454031.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Problem with starting web-app during startup

Posted by akuhtz <an...@siemens.com>.
Hi,

It works fine if the web-app is installed after startup, however I was not
able to get it working if it was installed as boot-feature, even with
changing the start-levels.

Thanks for all the reponses!

Regards
Andi

--
View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3467257.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Problem with starting web-app during startup

Posted by Raul Kripalani <ra...@fusesource.com>.
Hi Andi,

Try the following sequence, i.e. basically starting from scratch to make
sure you have no funny leftovers:

1) Shutdown Karaf
2) Deleting your data directory
3) Start Karaf, making sure that your custom features descriptor is *not* on
the bootstrap list.
4) Install the http, web and war features
5) Install your custom feature

Regards,
*
*
*
*
*Raúl Kripalani*
Principal Consultant | FuseSource Corp.
raul@fusesource.com | skype: raul.fuse
fusesource.com <http://www.fusesource.com/> | twitter:
@fusenews<http://twitter.com/fusenews>

"The experts in open source integration and messaging."



On 27 October 2011 22:17, Achim Nierbeck <bc...@googlemail.com> wrote:

> Hi Andi,
>
> yeah Raul is right and the relevant information is right here ;)
> the startlevel of the Pax Url war bundle is 60 and probably your bundle
> containing your war is the same,
> that's why it's not possible to run right away from start. You need to make
> sure your own Bundle is of startlevel higher then 60.
>
> regards, Achim
>
> 2011/10/27 akuhtz <an...@siemens.com>
>
>> Raul,
>>
>> Not sure if I get you right .... these are the only bundles with 'war' in
>> the name. But I don't know which contains the war protocol.
>>
>> [  82] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
>> Extender - WAR (1.0.6)
>> [  85] [Active     ] [            ] [       ] [   60] OPS4J Pax Url - war
>> (1.2.8)
>>
>> Regards,
>> Andi
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457762.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> --
> *Achim Nierbeck*
>
>
> 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/>
>

Re: Problem with starting web-app during startup

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Andi,

yeah Raul is right and the relevant information is right here ;)
the startlevel of the Pax Url war bundle is 60 and probably your bundle
containing your war is the same,
that's why it's not possible to run right away from start. You need to make
sure your own Bundle is of startlevel higher then 60.

regards, Achim

2011/10/27 akuhtz <an...@siemens.com>

> Raul,
>
> Not sure if I get you right .... these are the only bundles with 'war' in
> the name. But I don't know which contains the war protocol.
>
> [  82] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> Extender - WAR (1.0.6)
> [  85] [Active     ] [            ] [       ] [   60] OPS4J Pax Url - war
> (1.2.8)
>
> Regards,
> Andi
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457762.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
--
*Achim Nierbeck*


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/>

Re: Problem with starting web-app during startup

Posted by akuhtz <an...@siemens.com>.
Raul,

Not sure if I get you right .... these are the only bundles with 'war' in
the name. But I don't know which contains the war protocol.

[  82] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
Extender - WAR (1.0.6)
[  85] [Active     ] [            ] [       ] [   60] OPS4J Pax Url - war
(1.2.8)

Regards,
Andi



--
View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457762.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Problem with starting web-app during startup

Posted by Raul Kripalani <ra...@fusesource.com>.
Andi,

Can you send us relevant line from the output of the "la" command showing
the war protocol? Let's see what the bundle runlevel is...

I experienced a similar issue installing the classpath: protocol and later
realised that I needed to decrease the bundle's runlevel so that it's made
available in the container at an earlier stage during startup.

Regards,
Raúl.

On 27 October 2011 12:43, akuhtz <an...@siemens.com> wrote:

> Hi Ioannis,
>
> Ok, I removed the war from the feature of my web-app and added it to boot
> features, but the problem still exists.
> I guess it is because I've added the feature of my web-app to the boot
> features as well ... so I think I've to remove my web-app from boot
> features
> and have it deployed at a later stage. But I'm not sure what would be the
> best for that? Do I have to create a kar and put it into the deploy folder?
> Would this solve my problem?
>
> Regards,
> Andi
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457367.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Problem with starting web-app during startup

Posted by akuhtz <an...@siemens.com>.
Hi Ioannis,

Ok, I removed the war from the feature of my web-app and added it to boot
features, but the problem still exists.
I guess it is because I've added the feature of my web-app to the boot
features as well ... so I think I've to remove my web-app from boot features
and have it deployed at a later stage. But I'm not sure what would be the
best for that? Do I have to create a kar and put it into the deploy folder?
Would this solve my problem?

Regards,
Andi

--
View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457367.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Problem with starting web-app during startup

Posted by Ioannis Canellos <io...@gmail.com>.
Hi Andi,

You can have war feature and a bundle using the war protocol inside the same
feature. The reason is that the war protocol is made available to the
container once it is installed and will not be available at the time of the
resolution.

What you can do is to add the war feature in the boot features before your
own feature. I think that this will work.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Problem with starting web-app during startup

Posted by akuhtz <an...@siemens.com>.
Hi JB,

Yes, I can see the following line before the line with the error in the
logfile:
2011-10-27 12:51:50,912 INFO 
[org.apache.karaf.features.internal.FeaturesServiceImpl] (Thread-6)
Installing feature war 2.2.4

In Karaf-2.2.3 I haven't seen this error but my web-application was not
started during startup, too.

If I install the web-application bundle manually and restart karaf it is
started correctly, so maybe there is a problem with installing during
startup.

Regards
Andi


--
View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3457311.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Problem with starting web-app during startup

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Andi,

did you install the war feature ?

The war: protocol is provided by Pax Url War which is in the war feature:

features:install war

Regards
JB

On 10/26/2011 11:24 AM, akuhtz wrote:
> Hi,
>
> I'm using karaf-2.2.4 and want to start a web application (with wicket) when
> karaf starts. I've defined a feature that is listed under featureBoot in the
> org.apache.karaf.features.cfg.
> Unfortunately I get the following WARN during startup and the web app is not
> started. However if I start the feature manually from the console it starts
> without a problem. What am I missing? Is there anything I've to wait for? If
> yes, how can I configure it?
>
> This is my feature:
> 	<feature name="monitoring-server-web" version="${project.version}">
> 		<feature version="${apache-karaf-version}">war</feature>
> 		<feature version='${project.version}'>monitoring-server-core</feature>
> 		<bundle>mvn:org.apache.wicket/wicket/${wicket-version}</bundle>
> 		<bundle>mvn:org.apache.wicket/wicket-ioc/${wicket-version}</bundle>
> 		<bundle>mvn:org.apache.wicket/wicket-spring/${wicket-version}</bundle>
> 		<bundle>mvn:org.apache.wicket/wicket-extensions/${wicket-version}</bundle>
> 		<bundle
> start-level='70'>war:mvn:com.*somepackage*.server/monitoring-server-web/${project.version}/war?Webapp-Context=web-console</bundle>
> 	</feature>
>
> And this is the log from startup:
>
> 2011-10-26 11:05:14,471 DEBUG
> [org.apache.karaf.features.internal.FeaturesServiceImpl] (Thread-6) Checking
> war:mvn:com.*somepackage*.server/monitoring-server-web/2.0.3-SNAPSHOT/war?Webapp-Context=web-console
> 2011-10-26 11:05:14,471 WARN
> [org.apache.karaf.features.internal.FeaturesServiceImpl] (Thread-6) Error
> when installing feature monitoring-server-web:
> java.net.MalformedURLException: unknown protocol: war
>
>
> Regards,
> Andi
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Problem-with-starting-web-app-during-startup-tp3454031p3454031.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com