EJB JSF

hi,
i want to create an application using only EJB 3.0 and JSF. i use JDeveloper 10, when i create empty project and create entities from tables in Model project i have TopLink Essentials JPA.
i would like to deploy this application to GlassFish server.
do i have to pay for the TopLink library that is included?

You don't need to pay for TopLink Essentials - it's the free toplink version that Oracle donated to Glassfish as the RI for JPA.
See:
http://www.oracle.com/technology/products/ias/toplink/jpa/resources/faq.html
http://www.oracle.com/technology/jpa/index.html
https://glassfish.dev.java.net/javaee5/persistence/
And I don't agree with the other post, using 10.1.3 for JSF/EJB 3.0 application is perfectly fine.

Similar Messages

  • EJB-JSF Application : Data does not persist to the database

    Hi,
    I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
    Here is my scenario ( Iam using JDeveloper IDE to create this application) -
    SCENARIO START
    The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
    1.) INDEX.JSP
    2.) ADDUSER.JSP
    Step 1: Create the USERS Table in database
    CREATE TABLE users
    user_id serial,
    username varchar(255) NOT NULL,
    first_name varchar(255),
    last_name varchar(255),
    password char(64) NOT NULL,
    CONSTRAINT pk_users PRIMARY KEY (user_id)
    Step 2: Add Database Connection To JDeveloper
    Go to Database Connection Navigator and create a New Database Connection using the Wizard
    Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
    Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows �
    User.java -
    package lux.domain;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQuery;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "User.findAll", query = "select o from User o")
    @Table(name = "USERS")
    public class User implements Serializable {
    @Column(name="FIRST_NAME")
    private String firstName;
    @Column(name="LAST_NAME")
    private String lastName;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String username;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
    @SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
    @Column(name="USER_ID", nullable = false)
    private Long userId;
    public User() {
    public String getFirstName() {
    return firstName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public String getLastName() {
    return lastName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public String getUsername() {
    return username;
    public void setUsername(String username) {
    this.username = username;
    public Long getUserId() {
    return userId;
    public void setUserId(Long userId) {
    this.userId = userId;
    Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Again Right Click on Model and create Session Bean from Wizard which creates two files �
    UserDAOBean.java � Stateless Session Bean
    UserDAO.java � Local Interface
    package lux.facade;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import lux.domain.User;
    @Stateless(name="UserDAO")
    public class UserDAOBean implements UserDAO {
    @PersistenceContext(unitName="Model")
    private EntityManager em;
    public UserDAOBean() {
    public User getUser(int UserId) {
    User u = new User();
    u = em.find(User.class, UserId);
    return u;
    public List<User> getAllUsers() {
    Query q = em.createQuery("SELECT u FROM User u");
    List<User> users = q.getResultList();
    return users;
    public void createUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.persist(u);
    public void updateUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.merge(u);
    public void deleteUser(User u) {
    em.remove(u);
    private String hashPassword(String password) {
    StringBuilder sb = new StringBuilder();
    try {
    MessageDigest messageDigest = MessageDigest.getInstance("SHA");
    byte[] bs;
    bs = messageDigest.digest(password.getBytes());
    for (int i = 0; i < bs.length; i++) {
    String hexVal = Integer.toHexString(0xFF & bs);
    if (hexVal.length() == 1) {
    sb.append("0");
    sb.append(hexVal);
    } catch (NoSuchAlgorithmException ex) {
    Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
    return sb.toString();
    Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
    Step 7: Now Right Click on View/Controller Node and create a Java File �
    UserController.java -
    package lux.controllers;
    import javax.ejb.EJB;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import lux.domain.User;
    import lux.facade.UserDAO;
    public class UserController {
    @EJB UserDAO userDao;
    private User user;
    private DataModel model;
    public String createUser() {
    this.user = new User();
    return "create_new_user";
    public String saveUser() {
    String r = "success";
    try {
    userDao.createUser(user);
    } catch (Exception e) {
    e.printStackTrace();
    r = "failed";
    return r;
    public DataModel getUsers() {
    model = new ListDataModel(userDao.getAllUsers());
    return model;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Step 8: Configure page flow in faces-config.xml
    1. Create the JSP file adduser.jsp by right-clicking View-Controller
    node and selecting New > JSP. Use the wizard to create JSF � JSP Page, fill in
    File Name adduser.jsp, click Finish. -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New user</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:messages/>
    <h:panelGrid columns="2">
    <h:outputText value="Username"/>
    <h:inputText
    id="Username"
    value="#{user.user.username}"
    required="true"/>
    <h:outputText value="First name"/>
    <h:inputText
    id="FirstName"
    value="#{user.user.firstName}" />
    <h:outputText value="Last name"/>
    <h:inputText
    id="LastName"
    value="#{user.user.lastName}" />
    <h:outputText value="Password" />
    <h:inputSecret
    id="Password"
    value="#{user.user.password}"
    required="true" />
    <h:panelGroup/>
    <h:commandButton
    action="#{user.saveUser}"
    value="Save"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    2. Repeat the previous step for another JSP file failed.jsp.
    3. On failed.jsp add the string
    Save failed
    Next we configure the page flow.
    1. Open faces-config.xml.
    2. Create index.jsp -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>User Listing</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:outputText value="User Listing"/>
    <h:commandLink action="#{user.createUser}" value="Create a user"/>
    <h:dataTable value="#{user.user}"
    var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.username}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.firstName}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.lastName}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow�s label to create_new_user.
    4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
    ailed
    5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
    This creates the following faces-config.xml file �
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config>
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>lux.controllers.UserController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <value>#{username}</value>
    </managed-property>
    <managed-property>
    <property-name>firstName</property-name>
    <value>#{firstName}</value>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value>#{lastName}</value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <value>#{password}</value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>create_new_user</from-outcome>
    <to-view-id>/adduser.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/adduser.jsp</from-view-id>
    <navigation-case>
    <from-outcome>failed</from-outcome>
    <to-view-id>/failed.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
    Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model�s JAR and View-Controller�s
    WAR files to it.
    Step 11: Run the JSP Files
    SCENARIO END
    Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
    WHAT IS WRONG OUT HERE ???

    If you set a breakpoint in your createUser method - does this code get executed?
    We have a couple of tutorials that might show you how to do this.
    EJB/JSF with ADF-binding tutorial:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    EJB/JSF without ADF binding:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • Setting a new EJB + JSF development environment

    Dear friends,
    nowadays me and some friends are dealing with the task of define the a Java development environment for a big enterprise...
    After some discussion and also evaluating the available machinery (a Z/os mainframe, a DB2 database and some oter minor servers...) - we decided to use EJB + JSF/Servlets.
    The JSF 4.0/Servlets support web requests while the Mainframe bundle the business components (EJB 2.1).
    Is that correct?
    have you some advices about our first decisions ?
    the development tools will be also discussed but we are pending to Eclipse WTP and JBoss for local tests.. and also MAVEN and ANT to integrate all this bunch of technologies....
    do you have some tip about plugins or frameworks that could help us to design a confortable and productive office ?
    best regards,
    Felipe Ga�cho

    Hi Louis,
    Thanks for the swift reply and for the insight into how Jdeveloper initialisation operates. I have since added the "ojaudit -profilehelp" to the setup scripts so that the system folder is correctly initialised. However, it is still not helping with my problem :(
    The preferences.xml file is not getting created as part of the call. It creates quite a few other files, but not preferences.xml
    $ ojaudit -profilehelp
    Oracle JDeveloper Audit 11.1.1.4.0 (5923)
    Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    ADE version extension, using view: noshea_mos_test_view
    Defined profiles:
    Code Assist Rules
    All Metrics
    Compile Rules
    All Rules
    Javadoc Rules
    Audit Rules
    $ pwd
    /system11.1.1.4.37.59.23
    $ cd o.jdeveloper
    $ ls
    1.6.0_18-rev.jdk Default.kdf Eclipse.kdf applications.xml
    Brief.kdf DefaultWorkspace Emacs.kdf audit
    Classic.kdf Default_macosx.kdf VisualCPP.kdf ide.properties
    $
    I tried copying in a pre-created file, but i still see the same exception as before.
    At the moment, i am doing pretty much what the other team are doing in the make file :
    export JDEV_USER_DIR ; $(T_WORK)/jdevshiphome/jdeveloper/jdev/bin/ojaudit -profilehelp
    $(CP) $(NDE_PRODUCT_ROOT)/setup/preferences.xml $$PREF_FILE
    $(CHMOD) +w $$PREF_FILE;\
    Do you know how they generated the preferences.xml that they pick up from the setup directory? Maybe this is where im going wrong.
    The steps I follow to generate mine are:
    - Install Jdeveloper
    - Open jdeveloper, and use my audit profile as default.
    - close jdeveloper.
    - Copy the generated preferences.xml into my setup scripts.
    Then as part of the installation process
    - Install jdeveloper (using a script).
    - Run ojaudit -profilehelp.
    - copy the preferences.xml file into the o.jdeveloper directory.
    - Start Jdeveloper.
    Do I need to make some changes to this preferences.xml to somehow make it more generic before it can be reused.
    Thanks,

  • JasperReports not working in EAR/EJB/JSF application

    Hi,
    When trying to compile a report using JasperReports, I get this exception. I have an EAR application, pdf generation happens in an EJB module, called by a WAR (Glassfish 3, JSF 2).
    Any clue?
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jar:file:/C:/Users/Yannick%2520Majoros/dev/GestempsEE/dist/gfdeploy/GestempsEE/lib/jasperreports-3.7.0.jar!/net/sf/jasperreports/engine/dtds/jasperreport.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2541)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:1825)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:531)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:766)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:550)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2408)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1753)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:235)
    ... 73 more

    I did as you said:
    Sanity Test:-
    java -classpath .;MyEJB.jar LoadTest
    java.lang.ClassNotFoundException: com.myexample.IXMLSerializer
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at LoadTest.main(LoadTest.java:5)
    Now if I run the same command as follows
    java -classpath MyEJB.jar;.;dep1.jar LoadTest
    it works (including the dep1.jar in classpath)
    com.myexample.IXMLSerializer
    MyEJB.jar has the following structure:
    |
    &#9492;&#9472;&#9472;&#9472;META-INF\Manifest.mf
    Manifest-Version: 1.0
    Class-Path: dep1.jar
    dep1.jar is found in the same directory where I executed the sanity test command (since I unpacked the ear file)

  • Deploying EJB, JSF to soa suite application server

    Hello,
    I have a problem using EJB. I deployed my JSF page to my soa suite application server. But I think something is wrong between the communication of my page and the Bean. I keep getting the error :
    BO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught
    : javax.naming.NameNotFoundException, msg=HRFacade not found
    where HRFacade is the name of my bean. I'm very new to EJB but I want to learn how to use it within ADF and a soa suite application server (some that is NOT localhost :p). Could someone tell me what I do wrong. What is connecting EJB's to the pages. Should I use JNDI? A good course available on the internet is also welcome.
    Thanks for the replys

    Oké, little update. I let the message rest for a while and start with a new project. New problem :
    First I created a new Session Bean. Within this bean I declared a string message();
    In my bean self I returned "Hello World!" like you can see
    package org.EJBEx1.datamodel;
    import javax.ejb.Stateless;
    @Stateless(name="Bean")
    public class BeanBean implements Bean, BeanLocal {
    public BeanBean() {
    public String message() {
    return "Hello World!";
    Now I created a remote data control for this bean and I dragged Bean.Message.String to my JSP. My JSP creates a label witch is bind to #{bindings.message1.label}
    What I want to do is just when I open a new browser the label should contain: 'Hello World!' But when I open a browser the label contains : 'message_Return'. Could someone help me. I understand this is basics so please. After I've successfully deployed this new exersise I will see if my error still is the same on my application server. If it works I will post it.
    Thnx

  • Glassfish + EJB + JSF on xhtml pages, page not found

    Hello,
    I've create an EJB application with a web client part (war). I have a technoList.xhtml who display the list of all thechnologies. My page contains XHTML tags and JSF too.
    When i build my application, no problems. But when i try to load the technoList.html page, i receive a really strange answer:
    PWC6117: File "C:\Pestaforge\trunk\src\management\PestaForge\dist\gfdeploy\PestaForge-war_war\technoList.jsp" not found
    It seems that the server will found a JSP page ?!? why?
    i've search on my sources, but nothing contain the technoList.jsp link or anything else.
    Has someone a great idea?
    Wich mistakes have i done? Is there anything special to do to use JSF on Glassfish?
    All helps is welcome...
    David Johannot

    Hello,
    What do your Apache webserver logfiles tell you?
    John.
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • [UNSOLVED] deploy ejb-jsf application to jboss

    I have developed a very simple web application with jdev 10.1.3.1 j2ee edition (no adf). The application uses ejb 3.0 and jsf technology.
    The application follows the pattern of the ‘Java EE tutorial’ at this url:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm ,
    but it is much simpler and I don’t use security mechanisms.
    For instance I use a session façade.
    The application has two projects: Model and ViewController. To deploy the application I created an ejb jar deployment profile for the model project and a war deployment profile for the ViewController. Then I created a new ‘Deployment’ project with an ear deployment profile to assemble the ejb jar and war deployment profiles. In this way I was able to deploy to standalone oc4j.
    Now I want to deploy to jboss 4.0.4 GA, I mapped the jboss connection within jdev and selected ‘deploy to jboss’. The ear is transferred to the correct folder, but the application folder is not generated and the jboss log shows at least one error. As you can see below, it seems it expects the local-home tag for the session façade, but I deleted it as suggested in the tutorial.
    I really need help on this topic, thank you.
    Mauro
    2006-12-01 16:20:51,250 WARN [org.jboss.util.NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
    2006-12-01 16:20:51,250 DEBUG [org.jboss.web.tomcat.tc5.Tomcat5] Problem in init
    org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected one local-home tag)
         at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:749)
         at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
    Message was edited by:
    mauro avon

    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app 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/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <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>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <jsp-config/>
    <ejb-local-ref>
    <ejb-ref-name>ejb/ProvaScrFacade</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>provascr.business.ProvaScrFacadeLocal</local>
    <ejb-link>ProvaScrFacade</ejb-link>
    </ejb-local-ref>
    </web-app>

  • [RESOLVED]Previously Functional EJB/JSF Hits Error

    In what I believe to be a library problem, I'm getting an error in the starting of a JSF app that was previously functional. On deploy, I get the following error in the application log:
    08/07/22 14:13:58.731 ui_deployment_profile: Error preloading servlet
    javax.servlet.ServletException: Error instantiating servlet 'AFCStatsServlet'. Servlet class oracle.webcache.adf.servlet.AFCStatsServlet
    not found in web-application ui_deployment_profile
    I also get a runtime error when trying to pull up a page:
    08/07/22 14:16:34.547 ui_deployment_profile: Servlet error javax.servlet.ServletException: Error loading filter 'PCF', filter-class 'oracle.webcache.adf.filter.FacesPageCachingFilter' not found
    I've read a bit online but nothing seems to tell me what libary is associated aside from 'ADF Faces Cache' which has, for all appearances, already been added to the project. I confess I'm kind of panicky because I'm trying to get this project near production ready by my last day next week. This error kind of blind-sided me.
    Edit: I forgot to mention that I'm deploying this to a 10.1.3.3 OAS App Server.
    Message was edited by:
    RWBerg

    I did some more research to find out if and how I had used any WebCache technology. Turns out some sequence of actions had created a reference to the AFC libraries in web-inf/adf-faces-config and created a cache object there and mappings in the web-inf/web.xml config file.
    To recap, a fix to this problem is to change adf-faces-config to delete the library reference and delete the afc tags. Then open web.xml and remove anything to do with the webcache libraries and PCF. Here are the three, not-necessarily-contiguous objects I removed from that file:
    <filter>
    <filter-name>PCF</filter-name>
    <filter-class>oracle.webcache.adf.filter.FacesPageCachingFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>PCF</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <servlet>
    <servlet-name>AFCStatsServlet</servlet-name>
    <servlet-class>oracle.webcache.adf.servlet.AFCStatsServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

  • EJB 3.0 - JSF APPLICATION: DATA DOES NOT PERSIST TO THE DATABASE

    Hi,
    I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
    Here is my scenario ( Iam using JDeveloper IDE to create this application) -
    SCENARIO START
    The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
    1.) INDEX.JSP
    2.) ADDUSER.JSP
    Step 1: Create the USERS Table in database
    CREATE TABLE users
    user_id serial,
    username varchar(255) NOT NULL,
    first_name varchar(255),
    last_name varchar(255),
    password char(64) NOT NULL,
    CONSTRAINT pk_users PRIMARY KEY (user_id)
    Step 2: Add Database Connection To JDeveloper
    Go to Database Connection Navigator and create a New Database Connection using the Wizard
    Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
    Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
    Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows –
    User.java -
    package lux.domain;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQuery;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "User.findAll", query = "select o from User o")
    @Table(name = "USERS")
    public class User implements Serializable {
    @Column(name="FIRST_NAME")
    private String firstName;
    @Column(name="LAST_NAME")
    private String lastName;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String username;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
    @SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
    @Column(name="USER_ID", nullable = false)
    private Long userId;
    public User() {
    public String getFirstName() {
    return firstName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public String getLastName() {
    return lastName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public String getUsername() {
    return username;
    public void setUsername(String username) {
    this.username = username;
    public Long getUserId() {
    return userId;
    public void setUserId(Long userId) {
    this.userId = userId;
    Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
    Again Right Click on Model and create Session Bean from Wizard which creates two files –
    UserDAOBean.java – Stateless Session Bean
    UserDAO.java – Local Interface
    package lux.facade;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import lux.domain.User;
    @Stateless(name="UserDAO")
    public class UserDAOBean implements UserDAO {
    @PersistenceContext(unitName="Model")
    private EntityManager em;
    public UserDAOBean() {
    public User getUser(int UserId) {
    User u = new User();
    u = em.find(User.class, UserId);
    return u;
    public List<User> getAllUsers() {
    Query q = em.createQuery("SELECT u FROM User u");
    List<User> users = q.getResultList();
    return users;
    public void createUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.persist(u);
    public void updateUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.merge(u);
    public void deleteUser(User u) {
    em.remove(u);
    private String hashPassword(String password) {
    StringBuilder sb = new StringBuilder();
    try {
    MessageDigest messageDigest = MessageDigest.getInstance("SHA");
    byte[] bs;
    bs = messageDigest.digest(password.getBytes());
    for (int i = 0; i < bs.length; i++) {
    String hexVal = Integer.toHexString(0xFF & bs);
    if (hexVal.length() == 1) {
    sb.append("0");
    sb.append(hexVal);
    } catch (NoSuchAlgorithmException ex) {
    Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
    return sb.toString();
    Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
    Step 7: Now Right Click on View/Controller Node and create a Java File –
    UserController.java -
    package lux.controllers;
    import javax.ejb.EJB;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import lux.domain.User;
    import lux.facade.UserDAO;
    public class UserController {
    @EJB UserDAO userDao;
    private User user;
    private DataModel model;
    public String createUser() {
    this.user = new User();
    return "create_new_user";
    public String saveUser() {
    String r = "success";
    try {
    userDao.createUser(user);
    } catch (Exception e) {
    e.printStackTrace();
    r = "failed";
    return r;
    public DataModel getUsers() {
    model = new ListDataModel(userDao.getAllUsers());
    return model;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Step 8: Configure page flow in faces-config.xml
    1. Create the JSP file adduser.jsp by right-clicking View-Controller
    node and selecting New > JSP. Use the wizard to create JSF – JSP Page, fill in
    File Name adduser.jsp, click Finish. -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New user</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:messages/>
    <h:panelGrid columns="2">
    <h:outputText value="Username"/>
    <h:inputText
    id="Username"
    value="#{user.user.username}"
    required="true"/>
    <h:outputText value="First name"/>
    <h:inputText
    id="FirstName"
    value="#{user.user.firstName}" />
    <h:outputText value="Last name"/>
    <h:inputText
    id="LastName"
    value="#{user.user.lastName}" />
    <h:outputText value="Password" />
    <h:inputSecret
    id="Password"
    value="#{user.user.password}"
    required="true" />
    <h:panelGroup/>
    <h:commandButton
    action="#{user.saveUser}"
    value="Save"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    2. Repeat the previous step for another JSP file failed.jsp.
    3. On failed.jsp add the string
    Save failed
    Next we configure the page flow.
    1. Open faces-config.xml.
    2. Create index.jsp -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>User Listing</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:outputText value="User Listing"/>
    <h:commandLink action="#{user.createUser}" value="Create a user"/>
    <h:dataTable value="#{user.user}"
    var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.username}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.firstName}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.lastName}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow’s label to create_new_user.
    4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
    ailed
    5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
    This creates the following faces-config.xml file –
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config>
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>lux.controllers.UserController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <value>#{username}</value>
    </managed-property>
    <managed-property>
    <property-name>firstName</property-name>
    <value>#{firstName}</value>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value>#{lastName}</value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <value>#{password}</value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>create_new_user</from-outcome>
    <to-view-id>/adduser.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/adduser.jsp</from-view-id>
    <navigation-case>
    <from-outcome>failed</from-outcome>
    <to-view-id>/failed.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
    Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model’s JAR and View-Controller’s
    WAR files to it.
    Step 11: Run the JSP Files
    SCENARIO END
    Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
    WHAT IS WRONG OUT HERE ???

    If you set a breakpoint in your createUser method - does this code get executed?
    We have a couple of tutorials that might show you how to do this.
    EJB/JSF with ADF-binding tutorial:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    EJB/JSF without ADF binding:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • EjB 3.0 persist

    Hi All,
    I am using EJB 3.0 and JBOSS 4.0.3.
    I have two entities events and eventInfo .
    @Entity(access = AccessType.FIELD)
    @Table(name = EVENT_TABLE)
    @SequenceGenerator(name="LogSeq", sequenceName="event_log_seq")
    public class Events {
         @Id(generate=GeneratorType.SEQUENCE, generator="LogSeq")
         @Column(name = LOG_ID)
         private Integer logId;
    @OneToMany()               
         @JoinColumn(name=LOG_ID,referencedColumnName=LOG_ID)
         private Collection<EventInfo> options;
    @Entity(access = AccessType.FIELD)
    @Table(name = EVENT_INFO_TABLE)
    public class EventInfo {
         @EmbeddedId
         @AttributeOverrides( {
         @AttributeOverride(name = "logId", column = @Column(name = LOG_ID)),
         @AttributeOverride(name = "KeyId", column = @Column(name = OPTIONAL_INFO_KEY_ID)) })
         private EventOptionalInfoPK primaryKey;
         @Column(name = OPTIONAL_INFO_VALUE)
         private String value;
    and the following code is from a stateless session bean
    Events event = new Events(eventRecorder);
    Collection optionsList = eventRecorder.getOptionalInfoList();
    event.setOptions(optionalInfoList);          
    entityManager.persist(event);
    when i call persist on the events entity i would expect the eventInfo entity is also persisted. But instead an insert SQL is generated to insert the events record which is fine. But there is no insert SQL generated to insert the eventInfo .(?) instead the sql generated is update event_info set log_id where log_id =? and key_id =?
    Does any one know why there is no insert sql generated and why there is an update sql ? i was expecting some thing like
    insert into EVENT_INFO (LOG_ID,KEY_ID,VALUE) values(?,?,?)
    and bind log_id with events log_id generated.
    please help me ...
    Thanks

    If you set a breakpoint in your createUser method - does this code get executed?
    We have a couple of tutorials that might show you how to do this.
    EJB/JSF with ADF-binding tutorial:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    EJB/JSF without ADF binding:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • Error in deploying EJB 2.0 on OracleAS 10.1.2

    Hi All,
    This issue is related to a customer issue. I am trying to deploy an ejb-web application developed using JDeveloper 10.1.3 on OracleAS 10.1.2. The deployment fails with following error:
    Deployment failed: Nested exception
    Resolution:
    Base Exception:
    java.rmi.RemoteException
    deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Unknown persistence-manager tag: pm-properties. deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Unknown persistence-manager tag: pm-properties
    I guess this is some kind of version issue with some component in the application. I have tried to stick to EJB 2.0, J2EE 1.3 and J2SE 1.3 Versions in JDev, but to no avail.
    What would be the resolution to this issue? How can I deploy an EJB-JSF application developed using JDev 10.1.3 on OracleAS 10.1.2?
    Regards,
    Anand

    Hi All,
    This issue is related to a customer issue. I am trying to deploy an ejb-web application developed using JDeveloper 10.1.3 on OracleAS 10.1.2. The deployment fails with following error:
    Deployment failed: Nested exception
    Resolution:
    Base Exception:
    java.rmi.RemoteException
    deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Unknown persistence-manager tag: pm-properties. deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Unknown persistence-manager tag: pm-properties
    I guess this is some kind of version issue with some component in the application. I have tried to stick to EJB 2.0, J2EE 1.3 and J2SE 1.3 Versions in JDev, but to no avail.
    What would be the resolution to this issue? How can I deploy an EJB-JSF application developed using JDev 10.1.3 on OracleAS 10.1.2?
    Regards,
    Anand

  • Problem when getting array's elements in JSF

    Using Struts/EJB/JSF.
    Here is the code:
    Action servlets code:
    request.setAttribute("colSellers", (List<SellerDTO>) List );JSF part:
           <c:out value="${colSellers[projectForm.client].id}"/>Error message:
    *[ServletException in:/html/forms/project/read.jsp] The "[]" operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.'*
    But it works when i use real integer values....like
           <c:out value="${colSellers['2'].id}"/>

    Sorry, but this doesn't look like JSF, it looks like a combination of servlets, JSP EL and JSF. It will all work alot better if you choose your poison.
    Put the array in a managed bean and use a JSF component like h:datagrid or t:datalist to display the elements. If that seems too restrictive, do what I did and switch to Spring MVC.

  • Can't get JSF scriplet value.

    Hi all...
    I have a problem here when i'm applying EJB with JSF.
    Here is my code.
    EJB project
    package com.ejb;
    import javax.ejb.Remote;
    @Remote
    public interface daoCalculator {
         String getMessage();
    package com.ejb;
    import javax.ejb.Stateful;
    import com.ejb.daoCalculator;
    public @Stateful
    class daoCalculatorBean implements daoCalculator {
         public daoCalculatorBean() {
         public String getMessage() {
              if ((Math.random() * 10) > 5) {
                   return "Hello EJB World~!";
              } else
                   return "THis is not 0 !";
    _This is the JSF managed bean_
    package com.web;
    import javax.faces.event.ActionEvent;
    import com.ejb.*;
    import javax.ejb.*;
    * @author samuel
    public class intCalculator {
         @EJB (name="daoCalculatorBean/remote") private daoCalculator cart;
         String text;
         String text2;
         String text3;
         public intCalculator() {
         /*     try {
                   InitialContext ctx = new InitialContext();
                   cart = (daoCalculator) ctx.lookup("daoCalculatorBean/remote");
              } catch (Exception n) {
                   System.out.println(n);
         public String getText3() {
              return text3;
         public void setText3(String text3) {
              this.text3 = text3;
         public String getText2() {
              return text2;
         public void setText2(String text2) {
              this.text2 = text2;
         public String getText() {
              return text;
         public void setText(String text) {
              this.text = text;
         public void present(ActionEvent e) {
              text = cart.getMessage();
              text2 = cart.getMessage();
    }In my web-page(presentation layer), I'm able to get EJB function's value.
    But i can't use scriplet to retrieve "#{intCalculator.text3}".
    This is weird, because i can get this value if just apply Dynamic Web Project without EJB project.
    Did anyone face the same problem? Please kindly advice or share experience.
    Thanks in advance :)

    Hi...
    I think i shall explain my program.
    Actually I'm trying to implement JSF + EJB together.
    Initially, I just implement JSF and everything works fine. In managedBean (using session scope), i can create getter & setter with functions also and these items are retrievable in my JSP page with scirplet only ---> "#{managedBean.variableORfunction}"
    But this no longer happen with I implement EJB into it.
    here is the extra code for JSP side.
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <f:view>
         <h:panelGrid border="1" columns="2">
              <h:outputText value="1st"></h:outputText>
              <h:inputText value="#{intCalculator.text }"></h:inputText>
              <h:outputText value="2nd"></h:outputText>
              <h:inputText value="#{intCalculator.text2 }"></h:inputText>
              <h:outputText value="3rd"></h:outputText>
              <h:inputText value="#{intCalculator.text3}"></h:inputText>
         </h:panelGrid><h:form>
              <h:commandButton value="Press Me Pls~!" actionListener="#{intCalculator.present}"></h:commandButton>
              <h:commandButton value="Go Next Page~!" action="welcome"></h:commandButton>
         </h:form>
    </f:view>
    </body>
    </html>Usually if we implement only JSF, then intCalculator will be in the managed bean, text, text2, text3 will be in intCalculator with getter & setter. And in JSP page as above, we just need to place as above code. When the button "Press Me Pls~!" is trigger(press), then it shall redirect to the same page(because as above this button does not direct to any other page) and show the above text,text2 and text3 values right? (I mean if i just implement JSF only).
    Example:- if i type as below (ps: This is only with JSF)
    text = "Hello"
    text2 = "EJB"
    text3 = "JSF"
    then, it shall display in the textfields with the above values.(because it already store in intCalculator managedbean when button is pressed)
    But the problem occur when i implement EJB + JSF together. (ps: EJB + JSF)
    the managedBean seems like lost function. It couldn't store the value into the getter & setter in my managedBean.
    Fyi, I can call the function from sessionBean(EJB). (just try to prove that JNDI lookup is well done)
    I suspect the sessionBean(EJB) already created a sessionID and cause the managedBean session scope does not performing well. Is this possible? Is there any better approach for this solution?
    THanks for all of your time =D
    Do share experience if meet this kind of cases before. =D

  • JSF - NameNotFoundException

    Hi there.
    I am using JBoss 4.2, JSF 1.2 and Hibernate for my Webapp. I have 4 projects (EJB/JSF/EAR/EJBClient). I am trying to persist my entity bean via JNDI. And I am getting the following exception:
    javax.naming.NameNotFoundException: ServerSession not bound
    I am posting some sourcecode but I will try to keep it simple so that you dont have to read to much, promised. I have the following interface implemented:
    package mypackage...;
    import javax.ejb.Local;
    import mypackage....User;
    @Local
    public interface *ServerSessionLocalIF* {
         public Boolean login(String name, String password);
         public User getUser();
    }and the class using this interface looks like:
    package mypackage...;
    import java.util.Iterator;
    import java.util.List;
    import javax.ejb.Stateful;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import mypackage....User;
    @Stateful
    public class ServerSession *implements ServerSessionLocalIF {
         public static final String LocalJNDIName =  ServerSession.class.getSimpleName() + "/local";
         @PersistenceContext
         private EntityManager entityManager;
         private User user;
         public ServerSession() {}
         public User getUser() {
              return user;
         public Boolean login(String name, String password) {
              User user = new User();
              user.setName(name);
              user.setPassword(password);
              entityManager.persist(user);
              return true;
    }Now the following class throws a runtime exception that the bean cant be found (caused by the naming exception). Does anyone know how to get this work? What is missing for my context lookup to get work?
    package mypackage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class EJBService {
         private static EJBService singleton;
         private static Context ctx;
         private EJBService() throws NamingException{
              if (ctx == null) {
                   ctx = new InitialContext();
        public static <T> T lookup(Class<T> ejbClassType, String name) {
              if (singleton == null) {
                   try {
                        singleton = new EJBService();
                   catch (NamingException ne) {
                     throw new RuntimeException(ne.getLocalizedMessage(), ne);
            try {
                final Object object = ctx.lookup(name);
                if (ejbClassType.isAssignableFrom(object.getClass())) {
                    return (T) object;
                } else {
                    throw new RuntimeException(String.format(
                            "Class found: %s cannot be assigned to type: %s",
                            object.getClass(), ejbClassType));
            } catch (NamingException e) {
                throw new RuntimeException(String.format(
                        "Unable to find ejb for %s", ejbClassType.getName()), e);
    }Edited by: Tashtego2008 on Dec 13, 2008 3:44 AM

    Found the solution myself, but dont really know why. Within the EJBService class i have to modify the lookup like following:
    final Object object = ctx.lookup("MyProjectname/" + name);Now it works.

  • JSF  - Deployment failure

    Hi,
    I have an EJB,JSF applic. and I'm facing a missing java class error at deployment time.
    I have included the required libraries (reported as needed) at:
    - ViewController level ( accesing Project Properties ->Libraries)
    - Model level
    For WAR deployment profile properties, I've also selected the coresponding Contributors in WEB-INF/lib.
    When I redeploy the EAR, I receive the same missing java class error .
    Thank you in advance,

    Thanks for your quick response,
    - Jdev 10.1.3.5
    - Missing class: oracle.jbo.common.JboResourceBundle
    - The included libraries are: bc4jmt.jar ,bc4jct.jar and adfm.jar (according to the message bellow)
    The missing class is available from the following locations:
         1. Code-Source: /opt/oas/product/10.1.3.2.0/OracleAS_1/BC4J/lib/bc4jmt.jar (from <code-source> in /opt/oas/product/10.1.3.2.0/OracleAS_1/j2ee/home/config/server.xml)
         This code-source is available in loader adf.oracle.domain:10.1.3.1. This shared-library can be imported by the "TOAPP" application.
    ... and the same for bc4jct.jar, adfm.jar
    Regards,

Maybe you are looking for

  • How to Put BPEL exercise,in apps.

    Hi, The Sample purchasing application which is given as a BPEL exercise, can we put it in apps appart from puting to local BPEL server.If yes then how to go about it. Thanks

  • SUM WITHOUT GROUP CLAUSE

    I want to sum the total of Positive Balances and Negative Balances in table. My DDL is as under:- CREATE TABLE LUQMAN (ID NUMBER(1), AMOUNT NUMBER(5)); INSERT INTO LUQMAN VALUES(1,20000); INSERT INTO LUQMAN VALUES(1,-2000); INSERT INTO LUQMAN VALUES(

  • Repositioning viewport of column size change

    I have a JTable with multiple columns and rows. Columns can be resized or moved by dragging the column headers. Whenever a column is resized the table viewport jumps to the top of the table. I am looking for a way to either hold the viewport at the c

  • Issues monitoring the 2602i Cisco AP with Zabbix.

    Hi! My workplace just bought a lot of Cisco AP (2602i) and a WLC 2500 and I'm in deep trouble trying to monitor them with Zabbix, wich is the SW we use for our whole Network. After a lot of time I got to monitor the CPU use (in %), traffic of each in

  • Won't stay closed

    My PowerBook has never closed lightly - which I know is not uncommon - but now it won't remain closed without coaxing. Pressing on the lid and it springs open. Other times it pops open on its own. Suggestions?