NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

EAR Deployment

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
brizznady



Joined: 27 Apr 2011
Posts: 4

PostPosted: Wed Apr 27, 2011 8:21 pm    Post subject: EAR Deployment Reply with 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’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: 612
Location: Simpsonville, SC

PostPosted: Thu Apr 28, 2011 12:47 pm    Post subject: Re: EAR Deployment Reply with quote

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

PostPosted: Thu Apr 28, 2011 8:34 pm    Post subject: Reply with quote

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: 612
Location: Simpsonville, SC

PostPosted: Fri Apr 29, 2011 12:56 pm    Post subject: Re: EAR Deployment Reply with quote

Check your weblogic.xml for the library reference below like below. This is for Weblogic 10.3.3. You will also need to configure the library on the server.

<?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">
Back to top
brizznady



Joined: 27 Apr 2011
Posts: 4

PostPosted: Sun May 01, 2011 5:17 am    Post subject: Reply with quote

<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

PostPosted: Sun May 01, 2011 5:20 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo