Dynamic Web Project with Seam Faces - jsf

I tried to start a new dynamic Web Project with Seam-Faces(Eclipse). I created a new JSF-Facility and addeed all the jar-Files from the official Seam-Faces homepage. When i try to create a dynamic web project eclipse says that the following File ist not found:
javax.faces.FactoryFinder
What i am doing wrong ? Is ist possible to use Seam-Faces without the Seam-Framework ?

There is not a Seam Framework anymore. Seam 3 is a bunch of reusable CDI extensions that you could use. The best way to start with Seam3 modules is to use maven for library management. More info about how to configure seam-faces dependencies can be found here.
For the exception you're facing make sure there are no jsf jars in WEB-INF\lib in case you're using a Java EE server like JBoss AS or Glassfish. For more info look here.

Related

Apache Karaf Deploying .War File

My purpose is to run a JSF application on OSGI Framework. So, I am trying to deploy a WAR file to a servlet container for OSGi web applications, called PAX-WEB. I have a proper working JSF implementation working on WildFly 8.0 application server. I succesfully created OSGi-ified WAR file from this application. When I try to deploy it into PAX-WEB using Maven the following error occurs:
missing requirement: javax.servlet.annotation
I have these JARs in /lib folder of my application: jsf-api-2.1.7, jsf-impl-2.1.7, jsp-api-2.1, jstl-1.2. When I add javax.servlet-api-3.0.1.jar to my WAR file and re-deploy it, this time the following error occurs:
javax.faces.webapp.FacesServlet cannot be cast to javax.servlet.Servlet
With this error, I can run my JSF page, but it is not displaying JSF tags.
You're mixing two issues here.
One, your framework setup is missing the servlet classes. So in that case I propose to use the pax-web-jetty-bundle. It's an uber bundle and also contains and exports the servlet classes. In that case make sure you don't have the servlet jars in your framework setup available. Btw. taking a look at the samples and Integration tests of Pax Web itself helps already to understand which libraries are needed.
The second issue you are facing is an issue of adding the servlet classes to the war, this is per OSGi and servlet spec forbidden to do.
So without any further knowledge of your scenario you might be better of with using the Apache Karaf server (it uses Pax Web), cause there all infrastructure bundles are already included and known to work together.
One more thing, you get more and better feedback at the ops4j mailinglist.

JSF and cloudControl

I'm learning Java EE and it appear to me that One of the things to Know is JSF
I'm also sing cloudControl but I haven't found a Way to Deploy a JSF Applications there.
Is there a way of deploying a JSF Applications on cloudControl ?
As mentioned in the comment, you need to provide some implementation of JSF as a dependency together with embedded jetty or tomcat runner. Here you can find some example apps for tomcat and jetty. Maybe it would be also helpful for you to have a look on our existing java guides.

IllegalArgumentException: com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider

I am trying to deploy an application on Websphere 8.5.5
I've created a shared library for Websphere that includes myfaces 2.2 jars and other dependencies like commons-collections.
I also made the class loader of my application as PARENT_LAST.
When I deploy the application, I get this exception:
An error occured while initializing MyFaces: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
java.lang.IllegalArgumentException: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:557)
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:524)
I was looking at running a newer version of MyFaces on WAS 8.5.5, and ran into a similar issue. It appears to be a conflict between the code IBM wrote to support its embedded version of MyFaces, and an application- or shared library-provided MyFaces.
IBM provides a way to circumvent this issue. When WAS 8.0 shipped, it provided a feature to allow select either "SunRI1.2" or "MyFaces" as the server-provided JSF. Setting the default to "SunRI1.2" would remove the server-provided MyFaces from the classpath and allow the developer to provide their own.
Select any application
Click JSP and JSF Options
In the JSF implementation section, change the drop-down to SunRI1.2
Click OK
Save configuration and restart server

Using CDI except a Java Web Application

From Doc i m trying to learn Context and Dependency injection .
In tutorials CDI seems can be only use in a Web application.Can i use CDI in a Java Console project ? And How? I added libraries like javax.enterprice.deploy and cdi-api.I m trying to test Apache Shiro i referenced this part of Balusc detailed tutorial but i need to manage this without JSF and web Appli
http://docs.jboss.org/weld/reference/1.1.5.Final/en-US/html_single/#d0e5335
Yes, it can be used in an SE environment, though many of the scopes do not work, nor really make sense, in an SE environment.

Is JSF available as an OSGi (Equinox) bundle?

There is a bundle for JSP/JSTL, which can be deployed on Equinox OSGi Framework and can be used by other bundles then:
org.eclipse.equinox.jsp.jstl_1.0.0.jar
Is there also a bundle for JSF, so i can use JSF components in my bundles?
I really need to solve this issue, because i have to transform an extisting JSF Web Application to an OSGi Framework suited application.
Help please!
Recent versions of Mojarra, the JSF reference implementation, and of Apache MyFaces are available as OSGi bundles from Maven Central.
There is no need to use repackaged distributions like those from SpringSource.
Yes there is an osgi bundle.
You can pick one from
springsource.com/repository/app

Resources