You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by bitec <al...@gmail.com> on 2011/08/23 13:15:03 UTC

JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Hi. 

I'm struggling with installation of JSF enabled web applications to SMX
(karaf). The whole stack is here: 
http://fusesource.com/forums/thread.jspa?messageID=11739
http://fusesource.com/forums/thread.jspa?messageID=11739 

To be short: I tried the instructions, writtern here 
http://karaf.922171.n3.nabble.com/Apache-Karaf-amp-WAR-JSF-tt2465980.html#a2482122
http://karaf.922171.n3.nabble.com/Apache-Karaf-amp-WAR-JSF-tt2465980.html#a2482122 
by Achim Nierbeck. Bundles for myfaces 1.2 are installed and run
successfully, whe web application is also run with no exceptions. But when I
try the address http://localhost:8080/sample (I use "osgi:install
war:file:c:\\temp\\myfaces-test-helloworld-osgi-pax-web.war?Webapp-Context=sample"
command), there is no reply from web server. 

The logs also show, that the context was not initialized correctly: 

13:35:28,318 | INFO | qtp8441961-62 | WebXmlObserver | 161 -
org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using
myfaces-test-helloworld-osgi-pax-web as web application context name 
13:35:28,318 | INFO | qtp8441961-62 | WebXmlObserver | 161 -
org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using [] as web application
root path 
13:35:28,318 | INFO | qtp8441961-62 | HttpServiceFactoryImpl | 157 -
org.ops4j.pax.web.pax-web-runtime - 1.0.3 | Binding bundle:
[myfaces-test-helloworld-osgi-pax-web 231] to http service 
13:35:28,318 | INFO | qtp8441961-62 | log | 114 - org.eclipse.jetty.util -
7.4.1.v20110513 | started
HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@bd8e3b} 
13:35:28,334 | INFO | qtp8441961-62 | StartupServletContextListener | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Checking for
plugins:org.apache.myfaces.FACES_INIT_PLUGINS 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON' found, using default
value false 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS' found, using
default value false 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE' found, using default value
false 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | No context init parameter
'org.apache.myfaces.VIEWSTATE_JAVASCRIPT' found, using default value false 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Tomahawk jar not available.
Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter
are disabled now. 
13:35:28,334 | INFO | qtp8441961-62 | MyfacesConfig | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Starting up Tomahawk on the
MyFaces-JSF-Implementation 
13:35:28,334 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Reading standard config
META-INF/standard-faces-config.xml 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Reading config
/WEB-INF/faces-config.xml 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-api not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : myfaces-impl not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk12 not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox
not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox12
not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tomahawk-sandbox15
not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package :
myfaces-orchestra-core not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package :
myfaces-orchestra-core12 not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : trinidad-api not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : trinidad-impl not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : tobago not found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : commons-el not
found. 
13:35:28,381 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | MyFaces-package : jsp-api not found. 
13:35:28,381 | WARN | qtp8441961-62 | LocaleUtils | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Locale name in faces-config.xml null
or empty, setting locale to default locale : en_US 
13:35:28,396 | INFO | qtp8441961-62 | FacesConfigurator | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Serialization provider : class
org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory 
*13:35:28,396 | WARN | qtp8441961-62 | AbstractFacesInitializer | 223 -
org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'from id' does
not exist null/helloWorld.jsp *
13:35:28,396 | WARN | qtp8441961-62 | AbstractFacesInitializer | 223 -
org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'to id' does not
exist null/page2.jsp 
13:35:28,396 | WARN | qtp8441961-62 | AbstractFacesInitializer | 223 -
org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'from id' does
not exist null/page2.jsp
13:35:28,396 | WARN | qtp8441961-62 | AbstractFacesInitializer | 223 -
org.apache.myfaces.core.impl - 1.2.9 | File for navigation 'to id' does not
exist null/helloWorld.jsp 
*13:35:28,396 | INFO | qtp8441961-62 | AbstractFacesInitializer | 223 -
org.apache.myfaces.core.impl - *1.2.9 | ServletContext 'null' initialized.**
13:35:28,396 | INFO | qtp8441961-62 | StartupServletContextListener | 223 -
org.apache.myfaces.core.impl - 1.2.9 | Checking for
plugins:org.apache.myfaces.FACES_INIT_PLUGINS 

What can be the reason? Is it ever possible to use JSF inside Karaf? 

Thanks, Anton.

--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3277669.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

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

see comments inline.

Regards, Achim

Am 24.08.2011 21:15, schrieb bitec:
> Ok, fixed this one.
>
> As the hack, I removed legacy "export-package" from pax-web-jsp bundle
> Manifest file:

ok, I added the el language for convenience to get 1.2 faces running.

>
> javax.servlet.js
>   p;version="1.1.2",javax.servlet.jsp.el;version="1.1.2",javax.servlet.
>   jsp.jstl.core;version="1.1.2",javax.servlet.jsp.jstl.fmt;version="1.1
>   .2",javax.servlet.jsp.jstl.sql;version="1.1.2",javax.servlet.jsp.jstl
>   .tlv;version="1.1.2"
>
> After this the el language seemed to work ok.
> The better way (will check tomorrow) is to write versions for *javax.el* and
> others explicetely in my import-packages header. By default they got the old
> ones

You surely should always make sure you only import the packages you
require by adding the required version range.

> The fix for tag libraries is borrowed from this
> post:http://groups.google.com/group/spring-osgi/msg/8d12c504c3a6f98d?pli=1
>
> I replaced the DefaultFaceletConfigResourceProvider from myfaces and loaded
> tag libraries explicetely:
>
> URL url1 = getClassLoader().getResource("META-INF/primefaces-i.taglib.xml");
>          URL url2 =
> getClassLoader().getResource("META-INF/primefaces-p.taglib.xml");
>
>          urlSet.add(url2);
>          urlSet.add(url1);
>
>
> I can say, that working with osgi is like terror. The last thing, which I
> didn't solve: images from PF were not loaded successfully. Everything else
> seem to work. Hope my posts will help anyone else

it's not OSGi that is the terror here, it's more the issue of all those 
dynamic
class-loading things that give you hell here :-) JSF in particular is 
not easy to get
the way you want it.

Pax-Web JSP does try to get around this by
1) altering the usage of the classloader
2) scanning the libraries of the bundle for contained taglibs.
3) fails on the using the javax.faces.context.FacesContextFactory for 
initializing MyFaces 2.0 :(

I'm working on supporting MyFaces 2.1 and Servlet 3.0 right now I might 
also find a solution for 3 then :-)

>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281853.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: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
Never mind, though, I would prefer someone else to spend time on this :)

About 1.1.2 versions - I really don't know exact requirements of each
library I use. Actually I think 1.1.2 are not required by JSF 1.2. But it's
very difficult to check this as I will have to dive into different web
servers and dive into manifest files from each jar file to get the version.
When using app server you always know, which version of app server (not
exact jar files!) you need for required framework version: Tomcat 6+ and GF
2+ for JSF 1.2 and Tomcat 7+, GF 3+ for JSF 2.0. That's simple :)

By the way I tried to restrict EL version using import-package (plus
dynamicImport-Package option):
javax.el;version="2.1.0",
javax.servlet.jsp;version="2.1.0",
org.apache.jasper.compiler;version="2.1.0"

But for some reasons both versions of jsp were imported!!:

javax.servlet.jsp,version=1.1.2 from org.ops4j.pax.web.pax-web-jsp
(163)<http://localhost:8181/system/console/bundles/163>
javax.servlet.jsp,version=2.1.0 from org.ops4j.pax.web.pax-web-jsp
(163)<http://localhost:8181/system/console/bundles/163>

Here is the piece of my Manifest:

Build-Jdk: 1.6.0_20
Export-Package: com.luxoft.drf.web;version="1.0.0.SNAPSHOT",org.apache
 .myfaces.view.facelets.compiler;uses:="javax.el,org.xml.sax.ext,org.x
 ml.sax.helpers,org.xml.sax,javax.xml.parsers";version="2.0.2"
Embed-Directory: WEB-INF/lib
Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/spring-jdbc-3.0.5.RELE
 ASE.jar,WEB-INF/lib/commons-beanutils-1.8.3.jar,WEB-INF/lib/spring-tx
 -3.0.5.RELEASE.jar,WEB-INF/lib/myfaces-impl-2.0.2.jar,WEB-INF/lib/spr
 ing-expression-3.0.5.RELEASE.jar,WEB-INF/lib/commons-logging-1.1.1.ja
 r,WEB-INF/lib/commons-collections-3.2.jar,WEB-INF/lib/commons-lang-2.
 6.jar,WEB-INF/lib/slf4j-jdk14-1.6.1.jar,WEB-INF/lib/spring-context-3.
 0.5.RELEASE.jar,WEB-INF/lib/myfaces-api-2.0.2.jar,WEB-INF/lib/slf4j-a
 pi-1.6.1.jar,WEB-INF/lib/commons-digester-1.8.jar,WEB-INF/lib/primefa
 ces-2.2.1.jar,WEB-INF/lib/spring-beans-3.0.5.RELEASE.jar,WEB-INF/lib/
 spring-aop-3.0.5.RELEASE.jar,WEB-INF/lib/spring-core-3.0.5.RELEASE.ja
 r,WEB-INF/lib/aopalliance-1.0.jar,WEB-INF/lib/commons-codec-1.3.jar,W
 EB-INF/lib/spring-asm-3.0.5.RELEASE.jar,WEB-INF/lib/commons-discovery
 -0.4.jar
Tool: Bnd-1.43.0
Bundle-Name: drfusion-web
DynamicImport-Package: *
Bundle-Version: 1.0.0.SNAPSHOT
Bnd-LastModified: 1314252798262
Embed-Transitive: true
Bundle-ManifestVersion: 2
Bundle-Description: DRFusion web application
Bundle-SymbolicName: drfusion-war
Import-Package: javax.el;version="2.1.0",javax.servlet.jsp;version="2.
 1.0",javax.xml.parsers,org.apache.jasper.compiler;version="2.1.0",org
 .xml.sax,org.xml.sax.ext,org.xml.sax.helpers
Embed-Dependency: *;scope=compile|runtime

Can anyone advise, how to avoid legacy 1.1.2 version?

On Wed, Aug 24, 2011 at 11:52 PM, Achim Nierbeck [via Karaf] <
ml-node+3281929-1974180309-423945@n3.nabble.com> wrote:

> Ok one thing I really forgot.
>
> Thank you for sharing your experience with it it helps enabling the
> community :-)
>
> regards, Achim
>
> Am 24.08.2011 21:49, schrieb Achim Nierbeck:
>
> Hi,
>
> comments inline:
>
> Am 24.08.2011 21:15, schrieb bitec:
>
> Ok, fixed this one.
>
> As the hack, I removed legacy "export-package" from pax-web-jsp bundle
> Manifest file:
>
>
> ok, I added the el language for convenience to get 1.2 faces running.
>
>  javax.servlet.js
>  p;version="1.1.2",javax.servlet.jsp.el;version="1.1.2",javax.servlet.
>  jsp.jstl.core;version="1.1.2",javax.servlet.jsp.jstl.fmt;version="1.1
>  .2",javax.servlet.jsp.jstl.sql;version="1.1.2",javax.servlet.jsp.jstl
>  .tlv;version="1.1.2"
>
> After this the el language seemed to work ok.
> The better way (will check tomorrow) is to write versions for *javax.el* and
> others explicetely in my import-packages header. By default they got the old
> ones
>
>
> You surely should always make sure you only import the packages you
> require by adding the required version range.
>
>  The fix for tag libraries is borrowed from this
> post:http://groups.google.com/group/spring-osgi/msg/8d12c504c3a6f98d?pli=1
>
> I replaced the DefaultFaceletConfigResourceProvider from myfaces and loaded
> tag libraries explicetely:
>
> URL url1 = getClassLoader().getResource("META-INF/primefaces-i.taglib.xml");
>         URL url2 =
> getClassLoader().getResource("META-INF/primefaces-p.taglib.xml");
>
>         urlSet.add(url2);
>         urlSet.add(url1);
>
>
> I can say, that working with osgi is like terror. The last thing, which I
> didn't solve: images from PF were not loaded successfully. Everything else
> seem to work. Hope my posts will help anyone else
>
>
> it's not OSGi that is the terror here, it's more the issue of all those
> dynamic
> class-loading things that give you hell here :-) JSF in particular is not
> easy to get
>
> the way you want it.
>
> Pax-Web JSP does try to get around this by
> 1) altering the usage of the classloader
> 2) scanning the libraries of the bundle for contained taglibs.
> 3) fails on the using the javax.faces.context.FacesContextFactory for
> initializing M
>
>  --
> View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281853.html
>
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
> --
> --
> *Achim Nierbeck*
>
>
> Apache Karaf <http://karaf.apache.org/> <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>  Committer & Project Lead
> blog <http://notizblog.nierbeck.de/> <http://notizblog.nierbeck.de/>
>
>
>
> --
> --
> *Achim Nierbeck*
>
>
> Apache Karaf <http://karaf.apache.org/> <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>  Committer & Project Lead
> blog <http://notizblog.nierbeck.de/> <http://notizblog.nierbeck.de/>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281929.html
>  To unsubscribe from JSF and apache-servicemix-4.4.0-fuse-00-43 problems, click
> here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3277669&code=YWxpc292ZW5rb0BnbWFpbC5jb218MzI3NzY2OXwyNTk0NjU5MjI=>.
>
>


--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3283128.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by Achim Nierbeck <bc...@googlemail.com>.
Ok one thing I really forgot.

Thank you for sharing your experience with it it helps enabling the 
community :-)

regards, Achim

Am 24.08.2011 21:49, schrieb Achim Nierbeck:
> Hi,
>
> comments inline:
>
> Am 24.08.2011 21:15, schrieb bitec:
>> Ok, fixed this one.
>>
>> As the hack, I removed legacy "export-package" from pax-web-jsp bundle
>> Manifest file:
>
> ok, I added the el language for convenience to get 1.2 faces running.
>
>> javax.servlet.js
>>   p;version="1.1.2",javax.servlet.jsp.el;version="1.1.2",javax.servlet.
>>   jsp.jstl.core;version="1.1.2",javax.servlet.jsp.jstl.fmt;version="1.1
>>   .2",javax.servlet.jsp.jstl.sql;version="1.1.2",javax.servlet.jsp.jstl
>>   .tlv;version="1.1.2"
>>
>> After this the el language seemed to work ok.
>> The better way (will check tomorrow) is to write versions for *javax.el* and
>> others explicetely in my import-packages header. By default they got the old
>> ones
>
> You surely should always make sure you only import the packages you
> require by adding the required version range.
>
>> The fix for tag libraries is borrowed from this
>> post:http://groups.google.com/group/spring-osgi/msg/8d12c504c3a6f98d?pli=1
>>
>> I replaced the DefaultFaceletConfigResourceProvider from myfaces and loaded
>> tag libraries explicetely:
>>
>> URL url1 = getClassLoader().getResource("META-INF/primefaces-i.taglib.xml");
>>          URL url2 =
>> getClassLoader().getResource("META-INF/primefaces-p.taglib.xml");
>>
>>          urlSet.add(url2);
>>          urlSet.add(url1);
>>
>>
>> I can say, that working with osgi is like terror. The last thing, which I
>> didn't solve: images from PF were not loaded successfully. Everything else
>> seem to work. Hope my posts will help anyone else
>
> it's not OSGi that is the terror here, it's more the issue of all 
> those dynamic
> class-loading things that give you hell here :-) JSF in particular is 
> not easy to get
> the way you want it.
>
> Pax-Web JSP does try to get around this by
> 1) altering the usage of the classloader
> 2) scanning the libraries of the bundle for contained taglibs.
> 3) fails on the using the javax.faces.context.FacesContextFactory for 
> initializing M
>
>> --
>> View this message in context:http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281853.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/>


-- 
--
*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: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
Ok, fixed this one.

As the hack, I removed legacy "export-package" from pax-web-jsp bundle
Manifest file:

javax.servlet.js
 p;version="1.1.2",javax.servlet.jsp.el;version="1.1.2",javax.servlet.
 jsp.jstl.core;version="1.1.2",javax.servlet.jsp.jstl.fmt;version="1.1
 .2",javax.servlet.jsp.jstl.sql;version="1.1.2",javax.servlet.jsp.jstl
 .tlv;version="1.1.2"

After this the el language seemed to work ok.
The better way (will check tomorrow) is to write versions for *javax.el* and
others explicetely in my import-packages header. By default they got the old
ones

The fix for tag libraries is borrowed from this
post:http://groups.google.com/group/spring-osgi/msg/8d12c504c3a6f98d?pli=1

I replaced the DefaultFaceletConfigResourceProvider from myfaces and loaded
tag libraries explicetely:

URL url1 = getClassLoader().getResource("META-INF/primefaces-i.taglib.xml");
        URL url2 =
getClassLoader().getResource("META-INF/primefaces-p.taglib.xml");

        urlSet.add(url2);
        urlSet.add(url1);


I can say, that working with osgi is like terror. The last thing, which I
didn't solve: images from PF were not loaded successfully. Everything else
seem to work. Hope my posts will help anyone else


--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281853.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
What about the second problems (EL):

I have this piece of code:
<h:commandButton action="#{propertiesBean.save}" value="save"/>

It is rendered perfectly everywhere (Jetty, TOmcat).

But in SMX 4.4.0 it results in the following exception:

Caused by: javax.el.ELException: /properties.xhtml: The class
'com.luxoft.drf.web.PropertiesBean' does not have the property 'save'.
	at
org.apache.myfaces.view.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:55)
	at
org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:46)
	at
org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(UILeaf.java:214)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)

I know that even previous version of EL (2.1) worked perfectly with method
expressions, so this is a very strange error.

I tried to use the el-api and el-impl jars inside web application (no
import-packages for javax.el) and got the following exception:

Caused by: java.lang.LinkageError: loader constraint violation: loader
(instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5)
previously initiated loading for a different type with name
"javax/el/ExpressionFactory"
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
	at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1946)
	at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
	at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
	at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1806)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at
org.apache.myfaces.view.facelets.compiler.SAXCompiler$CompilationHandler.createAttributes(SAXCompiler.java:109)
	at
org.apache.myfaces.view.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:227)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:189)
	at
org.apache.myfaces.view.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:675)
	at
org.apache.myfaces.view.facelets.compiler.Compiler.compile(Compiler.java:118)
	at
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createFacelet(DefaultFaceletFactory.java:280)
	at
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:162)
	at
org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:137)
	at
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage._getFacelet(FaceletViewDeclarationLanguage.java:1888)
	at
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:311)
	at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:66)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239) 

Meaning that ELException cannot be loaded as it was loaded before. When??
What actually does this error mean? I avoided importing of ops4j.pax.web
libraries and thought that internal web app libraries for EL will be used.

Any help very appreciated!

--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3281548.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by Achim Nierbeck <bc...@googlemail.com>.
The best place for taglibs is the war itself,
you should place your tablibs jar inside the war.
The JSP classloader is enhance to find those inside the bundles libraries.

Actually the fragment Idea is not bad but that bundle isn't checked :-)

I guess I might introduce that in the future maybe, but we still have
an open issue for TLDs scanning for all bundles inside the container.
Either way I know that JSPs and taglibs are not easy and believe me
it's not easy to get the stuff working around it
since there is always some classloader stuff to take care of :-)

2011/8/24 bitec <al...@gmail.com>:
> I think org.ops4j.pax.web.pax-web-jsp bundle is responsible for:
> 1. expression language libraries (they are 2.1 and don't allow methodx
> expressions)
> 2. tag libraries. Though in this case I cannot understand, why JSF tag
> libraries were loaded, but PF - not.
>
> I tried to use the PF bundle as the fragment to
> org.ops4j.pax.web.pax-web-jsp, but this didn't help...
>
> Any thoughts?
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280706.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: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
I think org.ops4j.pax.web.pax-web-jsp bundle is responsible for:
1. expression language libraries (they are 2.1 and don't allow methodx
expressions)
2. tag libraries. Though in this case I cannot understand, why JSF tag
libraries were loaded, but PF - not.

I tried to use the PF bundle as the fragment to
org.ops4j.pax.web.pax-web-jsp, but this didn't help...

Any thoughts?

--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280706.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
I tried to use PrimeFaces as the separate bundle as the fragment to my
project. This didn't help, PF tag libraries are not used/seen

Can anyone advise me, what can I try to do?

Thanks

--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280589.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
Hi.

I simply used Myfaces 2.0.2 as inner dependencies. RSF-ri version 2 didn't
work (java.lang.IllegalStateException: Application was not properly
initialized at startup, could not find Factory:
javax.faces.context.FacesContextFactory)

I have two more troubles:
1. EL library is very old, I have to use constructions like
"<h:commandButton action="#{propertiesBean[save]}" value="Save"/>" where
save is the name of method. After attaching the EL-impl.jar and el-api.jar
some classloader exceptions raise (like class was already loaded by
felix.loader....). Ok, I can live with this.
2. Primefaces tag library is not loaded/seen. All PF tags are simply
ignored. That was the main reason, why I wanted to use JSF

Should I try to create the bundle for PF and load it separately?

Thanks

--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280456.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by Dan Tran <da...@gmail.com>.
me too :-)

On Tue, Aug 23, 2011 at 11:19 PM, Achim Nierbeck
<bc...@googlemail.com> wrote:
> Hi,
>
> great that you succeeded in enabling JSF on SMX :-)
> Could you give me a brief overview how you enabled myfaces 2.0, cause
> I think I still had some issues with that :-)
>
> regards, Achim
>
> 2011/8/24 bitec <al...@gmail.com>:
>> Ok, it's working. I should have tried the different address, not
>> localhost:8080, but localhost:8181 - the same one as for webconsole.
>>
>> "Great" that official SMX tutorial says about 8080 port:
>>
>> http://servicemix.apache.org/kernel/how-to-transform-your-smk-kernel-into-a-web-application-server-.html
>>
>> more curios, that this tutorial page is the copy of the one from blog:
>> http://cmoulliard.blogspot.com/2009/03/servicemix-4-as-web-application-server.html
>>
>> I spent lots of time struggling with this problem, hope someone else will be
>> more lucky if faces this problem and comes to this thread.
>>
>> Just now I managed to enable myfaces 2.0 both using web app libraries and
>> separate bundles, the only minor thing is obsolete el (method expressions
>> are not supported), but seems I need to add the latest EL library to web
>> libraries.
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280086.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: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

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

great that you succeeded in enabling JSF on SMX :-)
Could you give me a brief overview how you enabled myfaces 2.0, cause
I think I still had some issues with that :-)

regards, Achim

2011/8/24 bitec <al...@gmail.com>:
> Ok, it's working. I should have tried the different address, not
> localhost:8080, but localhost:8181 - the same one as for webconsole.
>
> "Great" that official SMX tutorial says about 8080 port:
>
> http://servicemix.apache.org/kernel/how-to-transform-your-smk-kernel-into-a-web-application-server-.html
>
> more curios, that this tutorial page is the copy of the one from blog:
> http://cmoulliard.blogspot.com/2009/03/servicemix-4-as-web-application-server.html
>
> I spent lots of time struggling with this problem, hope someone else will be
> more lucky if faces this problem and comes to this thread.
>
> Just now I managed to enable myfaces 2.0 both using web app libraries and
> separate bundles, the only minor thing is obsolete el (method expressions
> are not supported), but seems I need to add the latest EL library to web
> libraries.
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280086.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: JSF and apache-servicemix-4.4.0-fuse-00-43 problems

Posted by bitec <al...@gmail.com>.
Ok, it's working. I should have tried the different address, not
localhost:8080, but localhost:8181 - the same one as for webconsole. 

"Great" that official SMX tutorial says about 8080 port:

http://servicemix.apache.org/kernel/how-to-transform-your-smk-kernel-into-a-web-application-server-.html

more curios, that this tutorial page is the copy of the one from blog:
http://cmoulliard.blogspot.com/2009/03/servicemix-4-as-web-application-server.html

I spent lots of time struggling with this problem, hope someone else will be
more lucky if faces this problem and comes to this thread.

Just now I managed to enable myfaces 2.0 both using web app libraries and
separate bundles, the only minor thing is obsolete el (method expressions
are not supported), but seems I need to add the latest EL library to web
libraries.


--
View this message in context: http://karaf.922171.n3.nabble.com/JSF-and-apache-servicemix-4-4-0-fuse-00-43-problems-tp3277669p3280086.html
Sent from the Karaf - User mailing list archive at Nabble.com.