migrating jsf application from weblogic10 to weblogic 12c - weblogic12c

We are encountering issues while deploying the new core SDM modules (wars) in weblogic 12c version. The new SDM core module (wb-tss-core-sdm-web-war-0.9.1.war) uses the JSF ,SeamListeners & FacesServlet (version 1.2 jars) and we have found that the JSF 1.2 version is not directly compatible with the weblogic 12c version. Hence, the application deployment is failed with user defined listener conflict issue
As per Weblogic 12c documentation,
"WebLogic Server 12.1.1 has enhanced support for JSF and JSTL. In this
release, JSF 2.x and JSTL 1.2 have been incorporated directly in the
server's classpath. Your applications deployed to WebLogic Server can
seamlessly make use of JSF 2.x and JSTL 1.2 without requiring you to
deploy and reference separate shared libraries, as was the case in
previous releases. For backward compatibility, WebLogic Server
provides JSF and JSTL libraries that can be deployed and referenced by
applications. See Deploying JSF 1.2 and JSTL Libraries. "
We had tried to install the JSF 1.2 wars explicitly in the weblogic server path as per the documentation to support the backward compatibility and forced the SDM application/war to use the JSF 1.2 version jars by adding the below entries in the weblogic.xml .
<wls:library-ref>
<wls:library-name>jsf</wls:library-name>
<wls:specification-version>1.2</wls:specification-version>
<wls:implementation-version>1.2</wls:implementation-version>
<wls:exact-match>false</wls:exact-match>
</wls:library-ref>
But the deployment is failed again with FacesServlet listener issue as the "jsf-impl-1.2_04_P02.jar" jar is already part of (wb-tss-core-sdm-web-war-0.9.1.war) war .
Tried to add the following entries in the weblogic,xml to force the application to use the application specific jars/classes which are part of the application war file.
<wls:prefer-application-packages>
<wls:package-name>javax.faces.*</wls:package-name>
<wls:package-name>com.sun.faces.*</wls:package-name>
<wls:package-name>com.bea.faces.*</wls:package-name>
<wls:package-name>com.sun.facelets.*</wls:package-name>
</wls:prefer-application-packages>
After adding the above entries, the application deployment is completed successfully but have noticed the following errors in the console:
<BEA-101162> <User defined listener com.sun.faces.config.ConfigureListener failed: javax.faces.FacesException: org.jboss.seam.jsf.SeamApplicationFactory.
javax.faces.FacesException: org.jboss.seam.jsf.SeamApplicationFactory
Due to this above error, some of the Jasper file upload SDM screens are not accessible and it is getting failed with this error:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.render.RenderKitFactory. Attempting to find backup.
How do we get past this?

We had the same issue during migration of JBoss Seam application from Weblogic 10.3.3 to Weblogic 12.1.1.
It was resolved by switching to Weblogic's default JSF 2.1.14 and updating Seam version to 2.3.
Hope this helps.

Not sure if you saw the longer discussion on this question:
Migrating JSF-Application to Weblogic 12
This helped me when analysing a similar library migration issues (hibernate was on my list).

Related

AbstractJAXRS E No resource classes found : cxf 3.2.8 and websphere 9.0.5.3

I'm using WebSphere 9.0.5.3 and after migrating CXF-core lib from 3.1.x to 3.2.x I'm facing this problem :
AbstractJAXRS E No resource classes found
with CXF 3.1.x everything works fine my server is working and my rest services are working as well.
ps1: I have already disabled JAXRSEngine of WebSphere and working with my own libraries ( in the shared isolated package ) and as I said it was working fine with the previous version
ps2: I have already modified the class loader policy ( Multiple -
single )
with some debugging, I figured out that WebSphere is not even loading my classes ( annotated with #path)
ps3: have already upgraded jaxrs-ws-rs to 2.1.1 because CXF 3.2.x
supports JAX-RS latest 2.1 spec even though this spec is backward
compatible with jaxrs 2.0
and i have already upgraded also all the CXF JAXRS related jars and still have
the same problem
PS4: my application is working fine with tomcat 8 and Wildfly/JBoss so
i don't think i have a problem with my resources classes
PS5: in the same jar, the other classes are loaded so WebSphere is filtering the resources classes and not loading them
the main problem here is why websphere is not loading my resouruce classes i have just upgraded the jar and I kept the old configurations ?
The IBM WebSphere Application Server does not provide direct support for JAXRS 2.1. However, what you are attempting may still be possible. Beyond setting the "com.ibm.websphere.jaxrs.server.DisableIBMJAXRS20Engine" property to "true" you should also set the JAXRS provider to "2.0 spec" via the command prompt or administrative console, see the following for details: https://www.ibm.com/support/knowledgecenter/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/rwbs_jaxrs_coexist.html
Beyond this, if you need the JAX-RS 2.1 APIs, then you will need to package the APIs with your application. You might also need to use parent-last classloading or package them in an isolated shared library associated with your application. Either approach poses some classloading risk.

Warning: The page declares namespace http://xmlns.jcp.org/jsf/core no TagLibrary associated to namespace in JSF on TomEE

I'm trying to create a page that validates url parameters and redirects to error page when parameters are not present.
Developing on TomEE 1.7.3 and Eclipse. Project set to Development mode. I'm targeting JSF 2.2.
I've used these questions:
Redirect before loading the page in JSF2
NLS missing message: CANNOT_FIND_FACELET_TAGLIB
My code works, however I'm getting warnings on Eclipse and on Server:
How can I rid of these warnings? Will these show in Production environment too?
First of all, TomEE 1.7.x ships with JSF 2.1, not 2.2. The migrated xmlns.jcp.org namespace domain is only available since JSF 2.2. Unless you've manually upgraded TomEE itself to use JSF 2.2, this won't work at all and you should keep using java.sun.com XML namespace domain.
How can I rid of these warnings?
Have a concrete JSF 2.2 implementation JAR file in project's Build Path. In case of Java EE servers, this is usually to be done by setting the server as Targeted Runtime in project's properties. The server plugin will then auto-reference server's own libraries in Build Path. Obviously, this will only work properly if the server plugin is decent and you have correctly upgraded the server itself to physically use JSF 2.2.
If this still doesn't work (because of poor server plugin), then download the individual JSF implementation JAR file, put it somewhere in project (but NOT in /WEB-INF/lib, otherwise it will conflict with server's own JSF impl during runtime and cause class/method/abstract related exceptions over all place), and add it to project's Build Path.
Will these show in Production environment too?
I can't imagine how as production servers usually don't run server via an IDE and HTTP clients usually aren't able to monitor the server's VGA output.

Netbeans wizard for JSF pages doesn't recognize TomEE 1.6 to have Web Profile support

I am creating a Java EE 6 application with the help of Netbeans 8.0 and TomEE 1.6. I have successfully added the server to netbeans and even generated some entity classes. I am currenlty trying to generate some JSF pages using the Netbeans wizard. However I get the following message
Cannot be generated for Java EE 6 sources wihtout server with complete Java EE 6 Web profile support (at least EJB Lite support).
I am using TomEE 1.6.0.2 plus
The problem is Netbeans 8 has a bug in which it fails to find the tomee-common-[version].jar in the [TomEE]/lib directory.
The solution is to simply rename the jar file to an older version.
For example, you have [TomEE]/lib/tomee-common-1.6.0.2.jar or [TomEE]/lib/tomee-common-1.7.1.jar. Rename these files to [TomEE]/lib/tomee-common-1.6.0.jar
This should sort you out :)
you can use tomcatEE 1.7.2 with a few small changes
you find here:
http://zarnisfd.blogspot.com/
I think this also applies to TomEE 1.6
According to the following sites:
http://forums.netbeans.org/ntopic48005.html
https://netbeans.org/bugzilla/show_bug.cgi?id=210835
Tomcat does not support EJB's therefor you would need to use an enterprise server that at least supports EJB Lite. One such server would be GlassFish

converting JPA 1.0 to JPA 2.0

In eclipse ,I am trying to upgrade my JPA from 1.0 to 2.0 (EJB project). I have made changes in the library and using eclipselink also but when I am again creating a project it is not giving an option of JPA 2 in faclets to select
any one have some idea whats the problem
It will depend on the version of Eclipse, and the weblogic plugin (OEPE) you are using. Without the correct connectors Eclipse is only aware that WebLogic server can run JPA1.0.
Perhaps try the latest version of OEPE pack here and point it at your workspace.
You also need to make sure the version of WebLogic you are using supports JPA2- you have tagged the question as weblogic 10.x which only supports JPA2.0 in 10.3.4 and later, and may require you to patch weblogic to enable the support.

Spring Petclinic (2013 version) doesn't work in JBoss AS 7

I'm trying to run the Spring Petclinic example on JBoss AS 7.1.1. I've imported the maven project from https://github.com/SpringSource/spring-petclinic/ to Eclipse Juno and successfully deployed it, but http://localhost:8080/petclinic/ gives me HTTP Status 404 error.
The only problem I can see from the log is
JBAS011006: Not installing optional component
org.springframework.web.context.request.async.StandardServletAsyncWebRequest
due to exception:
org.jboss.as.server.deployment.DeploymentUnitProcessingException:
JBAS011054: Could not find default constructor for class
org.springframework.web.context.request.async.StandardServletAsyncWebRequest
but according to Spring3.2 and jboss as 7 it's normal behavior.
I've found some advices about modifying the Petclinic sample for JBoss, but all of them are for the old version of the sample, not the updated 2013 version (http://blog.springsource.org/2013/03/21/spring-petclinic-is-on-github/).
The sample works fine with Tomcat 7.0.39.
Update:
The problem only occurs when I run the sample from Eclipse using JBoss. As Andrzej said, building the app with standalone maven and deploying the resulting war works fine.
The problem is JBoss/JBoss Tools use incorrect war name and context root when deploying from Eclipse.
In pom.xml the war name is specified as <warName>petclinic</warName>, but JBoss uses "spring-petclinic" instead. Tomcat, Glassfish, and Weblogic don't have this problem and work correctly with deployment from Eclipse.
The workaround is either to use http://localhost:8080/spring-petclinic/ instead of http://localhost:8080/petclinic/ or configure the context root via WEB-INF/jboss-web.xml:
<jboss-web>
<context-root>petclinic</context-root>
</jboss-web>
The Spring Petclinic (2013 version) works well with Jboss AS7. Tried it with two Jboss versions. What you need is to build app with maven and deploy it to standalone/deployments folder.
Problem is running it from Eclipse Juno.