[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-804) ejb 3.0- jsf application: deploy error for session bean with no local home interface

Kogias Marios (JIRA) jira-events at jboss.com
Mon Jan 22 14:36:53 EST 2007


    [ http://jira.jboss.com/jira/browse/EJBTHREE-804?page=comments#action_12351377 ] 
            
Kogias Marios commented on EJBTHREE-804:
----------------------------------------

I didn't know that JBoss 4 is only J2EE 1.4 only compatible. I tried your workaround and I deployed your suggestion adding a local-home tag with the same class in web.xml :

    <ejb-local-ref>
        <ejb-ref-name>ejb/local/SessionEJB</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>ola.SessionEJBLocal</local>
        <local-home>ola.SessionEJBLocal</local-home>        
        <ejb-link>SessionEJB</ejb-link>
    </ejb-local-ref>

though the IDE (JDeveloper 10.1.3.1.0) understands it is a mistake because there isn't really a home.
Next I mapped the reference to the jndi location on jboss-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <ejb-ref>
        <ejb-ref-name>ejb/local/SessionEJB</ejb-ref-name>
        <local-jndi-name>ejb/local/SessionEJB</local-jndi-name>
    </ejb-ref>
</jboss-web>

since I really have no home, i had to use the same class on the local tag.
It didn't work. It raised an error 'ejb-ref ejb/local/SessionEJB found in jboss-web.xml but not in web.xml' I tried also the following jboss-web.xml(s):

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <ejb-ref>
        <ejb-ref-name>SessionEJB</ejb-ref-name>
        <local-jndi-name>ejb/local/SessionEJBLocal</local-jndi-name>
    </ejb-ref>
</jboss-web>

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <ejb-ref>
        <ejb-ref-name>ejb/local/SessionEJBLocal</ejb-ref-name>
        <local-jndi-name>SessionEJB</local-jndi-name>
    </ejb-ref>
</jboss-web>

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <ejb-ref>
        <ejb-ref-name>ejb/local/SessionEJB</ejb-ref-name>
        <local-jndi-name>ejb/local/SessionEJBLocal</local-jndi-name>
    </ejb-ref>
</jboss-web>

Nothing worked. In fact they all failed with the same exception as above.
Any suggestions?

> ejb 3.0- jsf application: deploy error for session bean with no local home interface
> ------------------------------------------------------------------------------------
>
>                 Key: EJBTHREE-804
>                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-804
>             Project: EJB 3.0
>          Issue Type: Bug
>         Environment: the as runs on a windows server 2003 enterprise edition service pack 1
>            Reporter: mauro avon
>         Assigned To: Bill Burke
>
> I have developed a very simple web application with Oracle JDeveloper 10.1.3.1 j2ee edition (no adf). The application uses ejb 3.0 and jsf technology.
>  
> 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.5 GA, I mapped the jboss connection within jdev and selected 'deploy to jboss'. The ear file is transferred to the correct folder, but the application folder is not generated and the jboss log shows at least one error. It seems it expects a local-home tag in the web.xml (related to a session bean). 
> Below I enclose the jboss log, the session bean definition, the web.xml file. As you can see in the web.xml the <local-home> tag is really missing. But home interfaces should not be used in ejb 3.0, and I cannot manage to add a local interface to my session bean and make the application work.
> I posted the problem to the forum but nobody answered (see reference)
> // log
> 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)
> // session bean class
> package provascr.business;
> import java.util.List;
> import javax.ejb.Stateless;
> import javax.persistence.EntityManager;
> import javax.persistence.PersistenceContext;
> import provascr.persistence.SoCnfCategTpinvito;
> @Stateless(name="ProvaScrFacade")
> public class ProvaScrFacadeBean implements ProvaScrFacade, 
>                                            ProvaScrFacadeLocal {
>                                            
>     @PersistenceContext(unitName="Model")
>     private EntityManager em;
>     public ProvaScrFacadeBean() {
>     }
>     public Object mergeEntity(Object entity) {
>         return em.merge(entity);
>     }
>     public Object persistEntity(Object entity) {
>         em.persist(entity);
>         return entity;
>     }
>     /** <code>select o from SoCnfCategTpinvito o</code> */
>     public List<SoCnfCategTpinvito> querySoCnfCategTpinvitoFindAll() {
>         return em.createNamedQuery("SoCnfCategTpinvito.findAll").getResultList();
>     }
>     
>     
> }
> // web.xml
> <?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>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list