NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
brizznady
Joined: 27 Apr 2011 Posts: 4
|
Posted: Wed Apr 27, 2011 8:21 pm Post subject: EAR Deployment |
|
|
Help!!!
I'm having problems deploying a test ear file that I created using NetBeans 7.0.
My objective was to create a test ear deployment that included a do-nothing ejb module and a very basic war module that includes a PrimeFaces JSF test page. I don’t care how I get there; I just need an example ear including a working PrimeFaces example that I can use to create my real application.
--------------------------------------------------------------------------------
Process :
In NetBeans create a new Java EE Enterprise Application
Select/Add Oracle WebLogic Server as the target
Accept all other defaults
This will create an ejb and war/web sub-project and add the modules to the Ent. Application.
Go to properties on the war/web project
Add JSF 2.0 as a framework
Select PrimeFaces 2.2.1 as the components suite under the components tab (there appears to be a bug with NetBeans here where the selection does not persist, however, this doesn’t appear to impact the editing of JSF pages or the overall project)
Add the PrimeFaces Library to the project under Libraries
This process should create a new index.xhtml file in the web pages folder
I deleted the index.jsp page because I only plan to use JSF
Select the Enterprise Application in the Projects List and run the application.
This should trigger the ear deployment.
--------------------------------------------------------------------------------
Error:
Deployment Failed: The message was: java.lang.ClassNotFoundException: javax.faces.context.PartialViewContextFactory
It appears to me that I'm missing the reference to the JSF shared library already deployed on the server or the reference to the PrimeFaces library that is packaged along with the project.
I have tried adding the library reference to the ear's weblogic-application.xml by copying the library reference from the war/web's weblogic.xml in to the weblogic-application.xml file. This did not help.
--------------------------------------------------------------------------------
Note:
You are able to run the web/war application separate from the ear without any errors. This is why I believe I have a packaging or configuration file error.
Any ideas?
|
|
| Back to top |
|
 |
jyeary
Joined: 21 Oct 2008 Posts: 605 Location: Simpsonville, SC
|
Posted: Thu Apr 28, 2011 12:47 pm Post subject: Re: EAR Deployment |
|
|
Weblogic has some specific requirements to get JSF 2 working from the Weblogic side. Have you tried deploying to GlassFish to ensure that the EAR file works on it? If not, please check. This may help you track down the issue.
On Wed, Apr 27, 2011 at 4:21 PM, brizznady <address-removed ([email]address-removed[/email])> wrote:
| Quote: | Help!!!
I'm having problems deploying a test ear file that I created using NetBeans 7.0.
My objective was to create a test ear deployment that included a do-nothing ejb module and a very basic war module that includes a PrimeFaces JSF test page. I don |
|
| Back to top |
|
 |
brizznady
Joined: 27 Apr 2011 Posts: 4
|
Posted: Thu Apr 28, 2011 8:34 pm Post subject: |
|
|
Thanks for the suggestion!
I did try deploying to the GlassFish container that was included with NetBeans 7 before posting my original message.
GlassFish worked fine without any modifications to the deployment descriptors.
I think it’s got to be a library issue. Maybe a pointing to PrimeFaces correctly in the weblogic-appilication.xml would solve this issue.
Thoughts? |
|
| Back to top |
|
 |
jyeary
Joined: 21 Oct 2008 Posts: 605 Location: Simpsonville, SC
|
|
| Back to top |
|
 |
brizznady
Joined: 27 Apr 2011 Posts: 4
|
Posted: Sun May 01, 2011 5:17 am Post subject: |
|
|
<removed to reply to original post>
<sorry for the spam I was trying to get the spacing fixed...failed...>
Last edited by brizznady on Sun May 01, 2011 5:22 am; edited 1 time in total |
|
| Back to top |
|
 |
brizznady
Joined: 27 Apr 2011 Posts: 4
|
Posted: Sun May 01, 2011 5:20 am Post subject: |
|
|
So far a disappointing conclusion...
For some reason deploying JSF on the server as a Shared Library and referencing it from the weblogic.xml within the war does not function properly.
I still have the gut feeling that I just don't have the correct ear level library deployment descriptors.
I thought the info here might be helpful but I'm not pro enough at this point to understand the implications of chaining the context root.
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/libraries.html
My EAR's Package Structure:
| Code: |
+Prime.ear
+META-INF
-MANIFEST.MF
-application.xml
-weblogic-application.xml
+lib
-primefaces-2.2.1.jar
+Prime-ejb.jar
+META-INF
-MANIFEST.MF
-weblogic-ejb-jar.xml
+test <ejb source folder>
-TestSessionBean.class
-TestSessionBeanLocal.class
+Prime-war.war
+META-INF
-MANIFEST.MF
+WEB-INF
-web.xml
-weblogic.xml
-index.xhtml
+classes <empty war source folder>
|
My weblogic.xml:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<jsp-descriptor>
<keepgenerated>true</keepgenerated>
</jsp-descriptor>
<context-root>/Prime-war</context-root>
<library-ref>
<library-name>jsf</library-name>
<specification-version>2.0</specification-version>
<implementation-version>1.0.0.0_2-0-2</implementation-version>
</library-ref>
</weblogic-web-app>
|
My web.xml:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
|
My application.xml:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<application version="1.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<display-name>Prime</display-name>
<module>
<web>
<web-uri>Prime-war.war</web-uri>
<context-root>/Prime-war</context-root>
</web>
</module>
<module>
<ejb>Prime-ejb.jar</ejb>
</module>
</application>
|
My weblogic-application.xml:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application
xmlns="http://www.bea.com/ns/weblogic/90"/>
|
I was able to get a PrimeFaces example project to function the fallowing ways.
Method 1:
When adding the JSF Framework to the Web/war project for the first time:
Select: Registered Libraries: JSF 2.0
Instead of: Server Library: JSF 2.0 [...ect...]
This will add the JSF API Jar to the EAR's lib directory and will place the JSF Impl, primefaces, and jstl Jars in the WAR's lib directory.
Method 2:
Write a custom packaging/deployment script that places all the dependent libs in the WAR's lib directory.
So, if anyone has the solution to using the JSF lib deployed on the server as a shared lib PLEASE let me know what I'm doing wrong. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|