Configuring Mojarra 2.1.X on Eclipse Indigo - eclipse

The User Library download from Properties/Project Facets/Java Server Faces only lists Apache and Mojarra 2.0.X options. And setting up a user library manually, if I add javax.faces-2.1.11.jar, it doesn't error, puts the jar in the entry, then says \jarfiles\jaf (missing). So I see no way to use Mojarra 2.1.X.

I am unable to understand completely that what are you saying? But as much as I can I understood that "you want you use Mojarra 2.1.X" in your project. Now here is the thing You should mention the server that you are using.
If you are using glassfish 3.1.x then you have to replace your javax.faces.jar present in /glassfish/modules folder with javax.faces-2.1.11.jar as the glassfish built in jar javax.faces.jar enforce glassfish to use Mojarra 2.1.6.Now if it is Tomcat then it is up to you that you have to add all jsf compulsory jars in your lib folder :) One last thing that if you are using anyother server which has built in support for JSF and you are unable to find How to replace your jar from that server or you have issue with admin access over that server then you can also upgrade JSF by placing the newer javax.faces.jar file in webapp's own /WEB-INF/lib folder and editing the /WEB-INF/glassfish-web.xml file to add the following two new entries: <class-loader delegate="false" /><property name="useBundledJsf" value="true" />.Keep in mind that you are only enforce Web servers to use your desired jars not the application servers because many applications servers are giving built in support for JSF. So Configuring Mojarra 2.1.X on Eclipse Indigo is somehow wrong to ask.You have to ask that how should I use Mojarra 2.1.x with my XXX server because eclipse is only IDE and these things are SOMEHOW managed by IDE but only in case of Webservers.Thanks :)

Related

Eclipse Luna with JBoss Tools does not export libraries

I'm attempting to upgrade our environment to Eclipse Luna w/ JBoss Tools from our current Indigo instance. Most things are sorted well enough, but I'm running into a wall when deploying our application to a JBoss server within Eclipse.
As far as I can see, the lib/ directory of the .ear file generated contains none of the transitive dependencies from maven that we would normally expect to see, and as a result the application does not deploy or run correctly on the server. For clarity, we use the 'use workspace metadata' deployment option on the JBoss server within Eclipse.
By contrast, if I right click on the relevant project within Eclipse and say Export... .ear file, the resulting .ear contains all the .jars that I'd expect inside the lib/ folder (there's over 50 of these things, so it's pretty easy to spot the difference). Subsequently dropping the .ear into the deploy directory of JBoss and starting a server manually has the application working fine.
Has anyone ever encountered this sort of issue within JBoss Tools / Luna, and if so what steps were taken to try and remediate it?
Cheers for any help.
Dave.
EDIT: For what it's worth, this is a JBoss Enterprise Application Platform 5.x server instance, and we're using JBoss EAP 5.2

Eclipse doesn't import all Axis2 jars but project still runs on Tomcat?

When I develop an Axis2 web service on Eclipse, I noticed that Eclipse is automatically copying the classes from the lib folder of Axis2 to the lib folder of the new project. However, not all classes from the lib folder of Axis2 are being copied. Interestingly, the web service runs without any problem when deployed to Tomcat via Eclipse even if some the jars from Axis2 were not copied. Also, when I viewed the temp file of Tomcat, Tomcat seems to generate the jars for the listed modules on modules.list of the web service.
Can someone enlighten me regarding what is happening on this? Why Eclipse doesn't copy all the jars from Axis2? Why can the web service run on Tomcat even without the other jars from Axis2? What are those temp files for? When and why is it being generated?
I tried to run the same project on WebSphere and I am encountering a ClassDefNotFound exception because of the missing jars. My problem was solved when I copied all the Axis2 jars that was not copied by Eclipse to my project. But I'm not comfortable with my solution because Tomcat can run my project even without those jars. Is my solution really the right solution? Or am I missing a configuration setting?
This is just for clarification:
My web service is already running in Axis2. My class loading policy is set to PARENT_LAST. I know that since WebSphere has its own Axis2 configuration, the class loading policy must be set to PARENT_LAST so that WebSphere will use the Axis2 from the project itself. Aside from setting the class loading policy, I did something to make my web service run on WebSphere. I describe what I did above. My question is why such method must be taken?
WebSphere has it's own axis2 configuration as part of its Java EE server spec for JAX-WS. Change your class loading policy to PARENT_LAST and check if that solves your problem.
Edit:
As the original post already states: WebSphere is a Java EE server depending on version it supports its the standard Java JAX-WS web services. Actually web services became part of the standard jdk.
If you use JAX-WS like mentioned in Introduction to JAX-WS or building web services then you don't have to add any 3rd party library for getting your web services running. As soon as you use the non JDK implementation like axis2 you have to package it with your application.
IBM didn't just pack the axis2 into their WAS/JDK, they modified it. I'm not sure what Tomcat delivers, however as long as you use JAX-WS it shouldn't matter. With JAX-WS you don't have any direct import of the org.apache.axis packages. If you use these imports you have to supply the libraries and make sure that yours are loaded.

JBoss Seam Project errors

I have a JBoss Seam project that a coworker created about a year ago. I'm taking over it now and it needs some work done. So I'm trying to setup the project in Eclipse Indigo. Here is the list of things I have installed so far:
JBoss 4.2.2 GA
JBoss Seam 2.2.0 GA
Glassfish v2.1
JBoss Seam Tools Plugin for Eclipse Indigo
For some reason I am not able to build the project to get an ear for JBoss. The errors I have are one in glassfish-builld.xml which says "Target clean does not exist in this project." And then I have errors in a bunch of generic.jsp file (I have no idea what their purpose is). The error for those is that a library for JBoss Seam called org.jboss.seam.wiki.util.WikiUtil cannot be found.
Can someone point me in the right direction to get this setup and running on JBoss?
Also org.jboss.seam.wiki.util.WikiUtil is a class that is a part of... Seam example project that is added to JBoss Seam distribution in examples/wiki directory. So if you really need it you will be able to find it there. But honestly I don't see any reason to put any dependency to Seam examples in project. Consider just deleting / commening out the code that refers to this class becasue it is probably some quick and dirty test code.
Do you want to run it on Glassfish or Jboss?
Did you import an entire eclipse project or create a new one?
I would first check the referenced libraries to see if there's anything missing(Libraries under Java Build Path for Helios, not sure if that differs from Indigo). Add a -verbose tag to the build and check out the output.

HSQL DB Conflicts with JBoss

I would like to use a custom version of the HSQL DB in an application that I am deploying in JBoss. However, JBoss already contains an HSQLDB.jar. The JBoss jar is being resolved by my application instead of the custom jar in my ear.
How can I use a different version of HSQL in my web application from the one that JBoss uses internally?
Can I remove the HSQLDB.jar included with JBoss without negatively impacting the Application Server?
The custom version it's just a newer version? If it's that the case than you can simply replace the jar in the Jboss lib folder. Jboss uses HSQLDB as far as I know for queue persistence.

JBoss / Eclipse RCP Integration

I've run into a problem with RCP and JBoss. I'm attempting to seperate the JBoss client libraries (i.e. the .jar files in the 'client' directory of the jboss distribution) from the ejbmodule. The dependency hierarchy goes:
company.client (ejbmodule containing ServiceRemote bean)
org.jboss.client (jboss client libraries)
The problem is that when the org.jboss.client attempts to load ServiceRemote from the server, it tries to do a lookup on ServiceRemote, it can't see it, and throws a ClassNotFoundException
Are there any resources/best practices out there of how to do jboss integration in RCP?
Found the answer - you can use the Eclipse Buddy system to allow low-level plugins to lookup classes which they couldn't normally see. More info here:
http://www.eclipsezone.com/articles/eclipse-vms/