You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by helander <le...@gmail.com> on 2012/07/29 20:02:57 UTC

Web application development using unpacked WAR

When developing the static content of a Web Application the JEE WAR
containers typically allows you to deploy an unpacked version of your WAR
and then you just edit the html-files directly in the file system and are
able to test them "immediately" (without having to pack and deploy a new
version of the WAR).

Is this possible to do in some way with WAR:s in Karaf?

/Lars



--
View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

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

thanks for clarifying,
the setup looks ok, the installed feature war is sufficient.
I'd take a look asap. From the provided log I can tell the
on the fly manifest building does fail. I have to take a look at it.

regards, Achim

2012/7/31 helander <le...@gmail.com>:
> Michael,
>
> I am using karaf 2.2.8.
>
> My file path was long, but not exceptionally long ;), and it did not contain
> any white-spaces (which sometimes creates problems).
>
> I did the test with karaf installed directly under C:\, and the behaviour
> was identical (same exception).
> I did also create a new webapp according to your instructions, and I still
> get the same behaviour using that web application.
>
> Before moving the war directory to the deploy folder, I install the "war"
> and "http" features. Maybe there are other features that I have to install
> to get the deployment to work ?
>
> Lars
>
>
> Michael Prieß wrote
>>
>> Hi Lars,
>>
>> with the command "headers yourBundleId" you can display the OSGi
>> manifest.If no manifest is provided inside your war the manifest will
>> be generated during the deployment.To generate a own manifest during
>> the maven build you can use the felix bundle plugin to generate a
>> WAB(WAR with OSGi manifest). But I think this doesn't matter in this
>> case.
>>
>> Try the following:
>> - Tell us which karaf version is in use.
>> - Your filepath looks strange. Try to run karaf under C:/karaf/deploy.
>> Does it work?
>> - Check if you can reproduce the behavior with this maven-archetype.
>> mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes
>> -DarchetypeArtifactId=maven-archetype-webapp
>> -DarchetypeVersion=RELEASE -DgroupId=org.apache.karaf.webapp
>> -DartifactId=webapp -DinteractiveMode=false
>>
>> @Achim
>> If I use a exploded war based on the "maven-archetype-webapp" pax-web
>> can't find the Web-ContextPath inside the manifest header. (Karaf
>> 2.2.8)
>>
>> Regards,
>>
>> Michael
>>
>>
>> 2012/7/30 helander &lt;lehswe@&gt;:
>>> Michael,
>>>
>>> there is no OSGI manifest (it's a "standard" WAR ).
>>> What do you mean by the "command headers ID"?
>>> Which Felix plugin?
>>>
>>> /Lars
>>>
>>>
>>>
>>> Michael Prieß wrote
>>>>
>>>> Seems like there is a problem with the symbolic name. Could you please
>>>> attach the exploded OSGi manifest, the output of the command headers
>>>> ID and the configuration of the felix plugin?
>>>>
>>>> Cheers,
>>>>
>>>> Michael
>>>>
>>>>
>>>> 2012/7/30 helander &lt;lehswe@&gt;:
>>>>> I have created a Jira:
>>>>>
>>>>> https://issues.apache.org/jira/browse/KARAF-1692
>>>>>
>>>>> /Lars
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
>>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025381.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025388.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Re: Web application development using unpacked WAR

Posted by helander <le...@gmail.com>.
Michael,

I am using karaf 2.2.8.

My file path was long, but not exceptionally long ;), and it did not contain
any white-spaces (which sometimes creates problems).

I did the test with karaf installed directly under C:\, and the behaviour
was identical (same exception).
I did also create a new webapp according to your instructions, and I still
get the same behaviour using that web application.

Before moving the war directory to the deploy folder, I install the "war"
and "http" features. Maybe there are other features that I have to install
to get the deployment to work ?

Lars


Michael Prieß wrote
> 
> Hi Lars,
> 
> with the command "headers yourBundleId" you can display the OSGi
> manifest.If no manifest is provided inside your war the manifest will
> be generated during the deployment.To generate a own manifest during
> the maven build you can use the felix bundle plugin to generate a
> WAB(WAR with OSGi manifest). But I think this doesn't matter in this
> case.
> 
> Try the following:
> - Tell us which karaf version is in use.
> - Your filepath looks strange. Try to run karaf under C:/karaf/deploy.
> Does it work?
> - Check if you can reproduce the behavior with this maven-archetype.
> mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes
> -DarchetypeArtifactId=maven-archetype-webapp
> -DarchetypeVersion=RELEASE -DgroupId=org.apache.karaf.webapp
> -DartifactId=webapp -DinteractiveMode=false
> 
> @Achim
> If I use a exploded war based on the "maven-archetype-webapp" pax-web
> can't find the Web-ContextPath inside the manifest header. (Karaf
> 2.2.8)
> 
> Regards,
> 
> Michael
> 
> 
> 2012/7/30 helander &lt;lehswe@&gt;:
>> Michael,
>>
>> there is no OSGI manifest (it's a "standard" WAR ).
>> What do you mean by the "command headers ID"?
>> Which Felix plugin?
>>
>> /Lars
>>
>>
>>
>> Michael Prieß wrote
>>>
>>> Seems like there is a problem with the symbolic name. Could you please
>>> attach the exploded OSGi manifest, the output of the command headers
>>> ID and the configuration of the felix plugin?
>>>
>>> Cheers,
>>>
>>> Michael
>>>
>>>
>>> 2012/7/30 helander &lt;lehswe@&gt;:
>>>> I have created a Jira:
>>>>
>>>> https://issues.apache.org/jira/browse/KARAF-1692
>>>>
>>>> /Lars
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025381.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
> 




--
View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025388.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

Posted by Michael Prieß <ma...@googlemail.com>.
Hi Lars,

with the command "headers yourBundleId" you can display the OSGi
manifest.If no manifest is provided inside your war the manifest will
be generated during the deployment.To generate a own manifest during
the maven build you can use the felix bundle plugin to generate a
WAB(WAR with OSGi manifest). But I think this doesn't matter in this
case.

Try the following:
- Tell us which karaf version is in use.
- Your filepath looks strange. Try to run karaf under C:/karaf/deploy.
Does it work?
- Check if you can reproduce the behavior with this maven-archetype.
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-webapp
-DarchetypeVersion=RELEASE -DgroupId=org.apache.karaf.webapp
-DartifactId=webapp -DinteractiveMode=false

@Achim
If I use a exploded war based on the "maven-archetype-webapp" pax-web
can't find the Web-ContextPath inside the manifest header. (Karaf
2.2.8)

Regards,

Michael


2012/7/30 helander <le...@gmail.com>:
> Michael,
>
> there is no OSGI manifest (it's a "standard" WAR ).
> What do you mean by the "command headers ID"?
> Which Felix plugin?
>
> /Lars
>
>
>
> Michael Prieß wrote
>>
>> Seems like there is a problem with the symbolic name. Could you please
>> attach the exploded OSGi manifest, the output of the command headers
>> ID and the configuration of the felix plugin?
>>
>> Cheers,
>>
>> Michael
>>
>>
>> 2012/7/30 helander &lt;lehswe@&gt;:
>>> I have created a Jira:
>>>
>>> https://issues.apache.org/jira/browse/KARAF-1692
>>>
>>> /Lars
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025381.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

Posted by helander <le...@gmail.com>.
Michael,

there is no OSGI manifest (it's a "standard" WAR ).
What do you mean by the "command headers ID"?
Which Felix plugin?

/Lars



Michael Prieß wrote
> 
> Seems like there is a problem with the symbolic name. Could you please
> attach the exploded OSGi manifest, the output of the command headers
> ID and the configuration of the felix plugin?
> 
> Cheers,
> 
> Michael
> 
> 
> 2012/7/30 helander &lt;lehswe@&gt;:
>> I have created a Jira:
>>
>> https://issues.apache.org/jira/browse/KARAF-1692
>>
>> /Lars
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
> 



--
View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025381.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

Posted by Michael Prieß <ma...@googlemail.com>.
Seems like there is a problem with the symbolic name. Could you please
attach the exploded OSGi manifest, the output of the command headers
ID and the configuration of the felix plugin?

Cheers,

Michael


2012/7/30 helander <le...@gmail.com>:
> I have created a Jira:
>
> https://issues.apache.org/jira/browse/KARAF-1692
>
> /Lars
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

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

I'll take a look at it.

regards, Achim

2012/7/30 helander <le...@gmail.com>:
> I have created a Jira:
>
> https://issues.apache.org/jira/browse/KARAF-1692
>
> /Lars
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Re: Web application development using unpacked WAR

Posted by helander <le...@gmail.com>.
I have created a Jira:

https://issues.apache.org/jira/browse/KARAF-1692

/Lars 



--
View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025372.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

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

you just need to make sure that your directory contains a postfix .war
and it should contain a web.xml

If this still doesn't work please open a jira for it :)
And a log trace would also be helpful.

regards, Achim

2012/7/30 helander <le...@gmail.com>:
> Achim,
>
> I had already tried to do that, but it did not work for me.
> Are there any specific requirements on the "war" content that needs to be
> met in order for this to work, e.g. mandatory entries in the manifest ?
>
> /Lars
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025362.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Re: Web application development using unpacked WAR

Posted by helander <le...@gmail.com>.
Achim,

I had already tried to do that, but it did not work for me. 
Are there any specific requirements on the "war" content that needs to be
met in order for this to work, e.g. mandatory entries in the manifest ?

/Lars



--
View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360p4025362.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Web application development using unpacked WAR

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

yes this is possible just deploy an exploded version of your war in the 
deploy folder.
Make sure it does end with *.war. This way the deployer can pick it up.

regards, Achim

Am 29.07.2012 20:02, schrieb helander:
> When developing the static content of a Web Application the JEE WAR
> containers typically allows you to deploy an unpacked version of your WAR
> and then you just edit the html-files directly in the file system and are
> able to test them "immediately" (without having to pack and deploy a new
> version of the WAR).
>
> Is this possible to do in some way with WAR:s in Karaf?
>
> /Lars
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Web-application-development-using-unpacked-WAR-tp4025360.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
- Apache Karaf <http://karaf.apache.org/> Committer & PMC
- OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>  Committer & Project Lead
- OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Committer & Project Lead
- Blog <http://notizblog.nierbeck.de/>