You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by mikhaht <mi...@codershouse.com> on 2013/04/03 15:33:34 UTC

deploy of war into karaf

Hi,

I'm trying to deploy a pwm WAR into karaf. This is first time ever that i've
launched a karaf console.

WAR that i'm trying to launch is pwm Password management servlet product. I
have allready a application that is running on karaf and i need to run pwm
for user password management for that product.

PWM home page:

http://code.google.com/p/pwm/

 I've trying to follow these instructions:
https://ops4j1.jira.com/wiki/display/paxweb/OSGi-fy+your+WAR#

And tried to managed to deploy modified war into deploy folder. Karaf
activates the bundle but i'm getting 404 error when trying into 
https://servername/pwm url.

Osgi:headers output
password :: pwm  (264)
----------------------
Manifest-Version = 1.1
Ant-Version = Apache Ant 1.7.1
Built-By = MHa
Webapp-Context = pwm
Build-Jdk = 1.6.0_26
Created-By = MHa

Bundle-Name = password :: pwm
Bundle-Description = Open source Password management servlet.
Bundle-SymbolicName = password-pwm
Bundle-Version = 1.6.4
Bundle-ManifestVersion = 2
Bundle-ClassPath = .,WEB-INF/lib

My custom manifest:
Manifest-Version: 1.1
Ant-Version: Apache Ant 1.7.1
Bundle-Version: 1.6.4
Build-Jdk: 1.6.0_26
Built-By: MHa
Bundle-Name: password :: pwm 
Bundle-ManifestVersion: 2
Created-By: MHa
Bundle-Description: Open source Password management servlet.
Bundle-SymbolicName: password-pwm
Bundle-ClassPath: .,WEB-INF/lib
Webapp-Context: /pwm
Web-ContextPath: /pwm

jar command to create a war:
jar -cvfm pwm.war my_manifest.mf *

So question is how i should deploy pwm?

With Regards,
Mika




--
View this message in context: http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: deploy of war into karaf

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

as you are building a WAB (war with manifest) you need to add the required
import packages to it.
In this case you'll need to import javax.servlet and probably more :)
Sometimes it's best to build the WAB with the maven-bundle-plugin.

Regards, Achim


2013/4/4 mikhaht <mi...@codershouse.com>

> Hi,
>
> Small steps .. after tinkering around I found logging from karaf console.
>
> I read osgify document once again and indeed it says add all jar files into
> a manifest classpath. As Achim said.
> So here is mine manifest at the moment:
>
> Manifest-Version: 1.1
> Ant-Version: Apache Ant 1.7.1
> Bundle-Version: 1.6.4
> Build-Jdk: 1.6.0_26
> Built-By: MHa
> Bundle-Name: password :: pwm
> Bundle-ManifestVersion: 2
> Created-By: MHa
> Bundle-Description: Open source Password management servlet.
> Bundle-SymbolicName: password-pwm
> Bundle-ClassPath: WEB-INF/lib/activation.jar,WEB-INF/lib/asm-3.1.jar,WE
>  B-INF/lib/axis.jar,WEB-INF/lib/cas-client-core-3.2.0.jar,WEB-INF/lib/C
>  hallengeResponseLCM.jar,WEB-INF/lib/commons-codec-1.4.jar,WEB-INF/lib/
>  commons-discovery-0.2.jar,WEB-INF/lib/commons-email-1.1.jar,WEB-INF/li
>  b/commons-fileupload-1.2.1.jar,WEB-INF/lib/commons-io-1.4.jar,WEB-INF/
>  lib/commons-lang-2.6.jar,WEB-INF/lib/commons-logging-1.1.1.jar,WEB-INF
>  /lib/commons-logging-api-1.1.1.jar,WEB-INF/lib/concurrentlinkedhashmap
>  -lru-1.3.jar,WEB-INF/lib/derby.jar,WEB-INF/lib/gson-1.7.1.jar,WEB-INF/
>  lib/httpclient-4.1.1.jar,WEB-INF/lib/httpclient-cache-4.1.1.jar,WEB-IN
>  F/lib/httpcore-4.1.jar,WEB-INF/lib/httpmime-4.1.1.jar,WEB-INF/lib/jack
>  son-core-asl-1.8.3.jar,WEB-INF/lib/jackson-jaxrs-1.8.3.jar,WEB-INF/lib
>  /jackson-mapper-asl-1.8.3.jar,WEB-INF/lib/jaxb-api-2.1.jar,WEB-INF/lib
>  /jaxb-impl-2.1.12.jar,WEB-INF/lib/jaxrpc.jar,WEB-INF/lib/jdbm-2.4.jar,
>  WEB-INF/lib/jdom.jar,WEB-INF/lib/je-5.0.58.jar,WEB-INF/lib/jersey-bund
>  le-1.12.jar,WEB-INF/lib/jettison-1.1.jar,WEB-INF/lib/jsr311-api-1.1.1.
>  jar,WEB-INF/lib/jsso.jar,WEB-INF/lib/ldapChai.jar,WEB-INF/lib/ldap.jar
>  ,WEB-INF/lib/log4j-1.2.15.jar,WEB-INF/lib/mail.jar,WEB-INF/lib/nmascli
>  ent.jar,WEB-INF/lib/NMASToolkit.jar,WEB-INF/lib/persistence-api-1.0.2.
>  jar,WEB-INF/lib/pwm-servlet.jar,WEB-INF/lib/stax-api-1.0-2.jar,WEB-INF
>  /lib/wsdl4j-1.5.1.jar
> Webapp-Context: /pwm
> Web-ContextPath: /pwm
>
>
> And now back to logging. This is the first error after i have copied my
> modified war file into deploy folder.
> "[0m [31m16:06:32,801 | ERROR | FelixStartLevel  | RegisterWebAppVisitorWC
> | ?                                   ? | 186 -
> org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Registration exception.
> Skipping.
> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener"
>
> So it looks like i'm missing some libraries or what?
>
>
> Mika
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371p4028378.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: deploy of war into karaf

Posted by mikhaht <mi...@codershouse.com>.
Hi,

Small steps .. after tinkering around I found logging from karaf console.

I read osgify document once again and indeed it says add all jar files into
a manifest classpath. As Achim said.
So here is mine manifest at the moment:

Manifest-Version: 1.1
Ant-Version: Apache Ant 1.7.1
Bundle-Version: 1.6.4
Build-Jdk: 1.6.0_26
Built-By: MHa
Bundle-Name: password :: pwm 
Bundle-ManifestVersion: 2
Created-By: MHa
Bundle-Description: Open source Password management servlet.
Bundle-SymbolicName: password-pwm
Bundle-ClassPath: WEB-INF/lib/activation.jar,WEB-INF/lib/asm-3.1.jar,WE
 B-INF/lib/axis.jar,WEB-INF/lib/cas-client-core-3.2.0.jar,WEB-INF/lib/C
 hallengeResponseLCM.jar,WEB-INF/lib/commons-codec-1.4.jar,WEB-INF/lib/
 commons-discovery-0.2.jar,WEB-INF/lib/commons-email-1.1.jar,WEB-INF/li
 b/commons-fileupload-1.2.1.jar,WEB-INF/lib/commons-io-1.4.jar,WEB-INF/
 lib/commons-lang-2.6.jar,WEB-INF/lib/commons-logging-1.1.1.jar,WEB-INF
 /lib/commons-logging-api-1.1.1.jar,WEB-INF/lib/concurrentlinkedhashmap
 -lru-1.3.jar,WEB-INF/lib/derby.jar,WEB-INF/lib/gson-1.7.1.jar,WEB-INF/
 lib/httpclient-4.1.1.jar,WEB-INF/lib/httpclient-cache-4.1.1.jar,WEB-IN
 F/lib/httpcore-4.1.jar,WEB-INF/lib/httpmime-4.1.1.jar,WEB-INF/lib/jack
 son-core-asl-1.8.3.jar,WEB-INF/lib/jackson-jaxrs-1.8.3.jar,WEB-INF/lib
 /jackson-mapper-asl-1.8.3.jar,WEB-INF/lib/jaxb-api-2.1.jar,WEB-INF/lib
 /jaxb-impl-2.1.12.jar,WEB-INF/lib/jaxrpc.jar,WEB-INF/lib/jdbm-2.4.jar,
 WEB-INF/lib/jdom.jar,WEB-INF/lib/je-5.0.58.jar,WEB-INF/lib/jersey-bund
 le-1.12.jar,WEB-INF/lib/jettison-1.1.jar,WEB-INF/lib/jsr311-api-1.1.1.
 jar,WEB-INF/lib/jsso.jar,WEB-INF/lib/ldapChai.jar,WEB-INF/lib/ldap.jar
 ,WEB-INF/lib/log4j-1.2.15.jar,WEB-INF/lib/mail.jar,WEB-INF/lib/nmascli
 ent.jar,WEB-INF/lib/NMASToolkit.jar,WEB-INF/lib/persistence-api-1.0.2.
 jar,WEB-INF/lib/pwm-servlet.jar,WEB-INF/lib/stax-api-1.0-2.jar,WEB-INF
 /lib/wsdl4j-1.5.1.jar
Webapp-Context: /pwm
Web-ContextPath: /pwm


And now back to logging. This is the first error after i have copied my
modified war file into deploy folder.
"[0m16:06:32,801 | ERROR | FelixStartLevel  | RegisterWebAppVisitorWC         
| ?                                   ? | 186 -
org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Registration exception.
Skipping.
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener"

So it looks like i'm missing some libraries or what?


Mika




--
View this message in context: http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371p4028378.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: deploy of war into karaf

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

if the deployment of a std. war doesn't work, it's most probably due to the
fact that some libs are included which are not supposed to be.
Regarding the steps, normally you just copy the war into the deploy folder
and take a look at the shell, on how the war-bundle is deployed. Usually it
does have a cryptic name with underscores. For some details take a look at
the bundle:header [bundleId], it'll show you the generated manifest.

Concerning your given manifest sample, you need add all jars in the lib
folder to the classpath entry, it's not enough to add the lib folder.

regards, Achim


2013/4/4 mikhaht <mi...@codershouse.com>

> Hi,
>
>  Karaf supports non-OSGi war. So you can try to deploy directly the war
>  (just copy in the deploy folder).
>
> This was first thing that i did. Unfortunately i did not work. Therefore I
> started to dig further.
> I'm looking as simple solution as possible so this is looking good for me
> ..
>
> What are the steps ..
> 1. Copy war on the deploy folder.
> 2. ?
>
> Mika
>
>
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371p4028376.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: deploy of war into karaf

Posted by mikhaht <mi...@codershouse.com>.
Hi,

 Karaf supports non-OSGi war. So you can try to deploy directly the war
 (just copy in the deploy folder).

This was first thing that i did. Unfortunately i did not work. Therefore I
started to dig further.  
I'm looking as simple solution as possible so this is looking good for me ..

What are the steps ..
1. Copy war on the deploy folder.
2. ?

Mika






--
View this message in context: http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371p4028376.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: deploy of war into karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
The classpath manifest entry doesn't seem to be right,
you should add all your embedded jars to it.

regards, Achim


2013/4/3 Jean-Baptiste Onofré <jb...@nanthrax.net>

> Hi,
>
> Karaf supports non-OSGi war. So you can try to deploy directly the war
> (just copy in the deploy folder).
>
> If you want to turn it as a Web Bundle, you can use the
> maven-bundle-plugin with the war packaging (just define an execution for
> the bundle creation).
>
> Regards
> JB
>
>
> On 04/03/2013 03:33 PM, mikhaht wrote:
>
>> Hi,
>>
>> I'm trying to deploy a pwm WAR into karaf. This is first time ever that
>> i've
>> launched a karaf console.
>>
>> WAR that i'm trying to launch is pwm Password management servlet product.
>> I
>> have allready a application that is running on karaf and i need to run pwm
>> for user password management for that product.
>>
>> PWM home page:
>>
>> http://code.google.com/p/pwm/
>>
>>   I've trying to follow these instructions:
>> https://ops4j1.jira.com/wiki/**display/paxweb/OSGi-fy+your+**WAR#<https://ops4j1.jira.com/wiki/display/paxweb/OSGi-fy+your+WAR#>
>>
>> And tried to managed to deploy modified war into deploy folder. Karaf
>> activates the bundle but i'm getting 404 error when trying into
>> https://servername/pwm url.
>>
>> Osgi:headers output
>> password :: pwm  (264)
>> ----------------------
>> Manifest-Version = 1.1
>> Ant-Version = Apache Ant 1.7.1
>> Built-By = MHa
>> Webapp-Context = pwm
>> Build-Jdk = 1.6.0_26
>> Created-By = MHa
>>
>> Bundle-Name = password :: pwm
>> Bundle-Description = Open source Password management servlet.
>> Bundle-SymbolicName = password-pwm
>> Bundle-Version = 1.6.4
>> Bundle-ManifestVersion = 2
>> Bundle-ClassPath = .,WEB-INF/lib
>>
>> My custom manifest:
>> Manifest-Version: 1.1
>> Ant-Version: Apache Ant 1.7.1
>> Bundle-Version: 1.6.4
>> Build-Jdk: 1.6.0_26
>> Built-By: MHa
>> Bundle-Name: password :: pwm
>> Bundle-ManifestVersion: 2
>> Created-By: MHa
>> Bundle-Description: Open source Password management servlet.
>> Bundle-SymbolicName: password-pwm
>> Bundle-ClassPath: .,WEB-INF/lib
>> Webapp-Context: /pwm
>> Web-ContextPath: /pwm
>>
>> jar command to create a war:
>> jar -cvfm pwm.war my_manifest.mf *
>>
>> So question is how i should deploy pwm?
>>
>> With Regards,
>> Mika
>>
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.**
>> com/deploy-of-war-into-karaf-**tp4028371.html<http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371.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
>



-- 

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: deploy of war into karaf

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

Karaf supports non-OSGi war. So you can try to deploy directly the war 
(just copy in the deploy folder).

If you want to turn it as a Web Bundle, you can use the 
maven-bundle-plugin with the war packaging (just define an execution for 
the bundle creation).

Regards
JB

On 04/03/2013 03:33 PM, mikhaht wrote:
> Hi,
>
> I'm trying to deploy a pwm WAR into karaf. This is first time ever that i've
> launched a karaf console.
>
> WAR that i'm trying to launch is pwm Password management servlet product. I
> have allready a application that is running on karaf and i need to run pwm
> for user password management for that product.
>
> PWM home page:
>
> http://code.google.com/p/pwm/
>
>   I've trying to follow these instructions:
> https://ops4j1.jira.com/wiki/display/paxweb/OSGi-fy+your+WAR#
>
> And tried to managed to deploy modified war into deploy folder. Karaf
> activates the bundle but i'm getting 404 error when trying into
> https://servername/pwm url.
>
> Osgi:headers output
> password :: pwm  (264)
> ----------------------
> Manifest-Version = 1.1
> Ant-Version = Apache Ant 1.7.1
> Built-By = MHa
> Webapp-Context = pwm
> Build-Jdk = 1.6.0_26
> Created-By = MHa
>
> Bundle-Name = password :: pwm
> Bundle-Description = Open source Password management servlet.
> Bundle-SymbolicName = password-pwm
> Bundle-Version = 1.6.4
> Bundle-ManifestVersion = 2
> Bundle-ClassPath = .,WEB-INF/lib
>
> My custom manifest:
> Manifest-Version: 1.1
> Ant-Version: Apache Ant 1.7.1
> Bundle-Version: 1.6.4
> Build-Jdk: 1.6.0_26
> Built-By: MHa
> Bundle-Name: password :: pwm
> Bundle-ManifestVersion: 2
> Created-By: MHa
> Bundle-Description: Open source Password management servlet.
> Bundle-SymbolicName: password-pwm
> Bundle-ClassPath: .,WEB-INF/lib
> Webapp-Context: /pwm
> Web-ContextPath: /pwm
>
> jar command to create a war:
> jar -cvfm pwm.war my_manifest.mf *
>
> So question is how i should deploy pwm?
>
> With Regards,
> Mika
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/deploy-of-war-into-karaf-tp4028371.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