[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-804) ejb 3.0- jsf application: deploy error for session bean with no local home interface
Bill Burke (JIRA)
jira-events at jboss.com
Mon Jan 22 12:49:08 EST 2007
[ http://jira.jboss.com/jira/browse/EJBTHREE-804?page=comments#action_12351364 ]
Bill Burke commented on EJBTHREE-804:
-------------------------------------
JBoss 4, except for EJB3 is only J2ee 1.4 compatible. This means what you are doing is not implemented in JBoss 4 + EJB3. What shoudl work is that you just define a <local-home> tag to be the same calss as the <local> and in jboss-web.xml map the reference to the jndi location of your local interface. I think that will work but don't have the cycles ATM to try it out.
> 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