[EJB 3.0] - EJB problem
by g_svadla
hi
I am new to EJBs. I am developing a J2EE application using NetBeans IDE. My project is deployed successfully, but when I try to run the servlet from the webmodule to retrieve data from the database, I get the error "javax.naming.NamingException: ejb-ref: ejb/CustomerFacadeBean, no ejb-link in web.xml and no jndi-name in jboss-web.xml"
and the output is "No such Entity!"
These are my web.xml and jboss-web.xml files
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.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/web-app_2_4.xsd">
<servlet-name>Movies</servlet-name>
<servlet-class>edu.umassd.ecom.Movies</servlet-class>
<servlet-name>Dates</servlet-name>
<servlet-class>edu.umassd.ecom.Dates</servlet-class>
<servlet-name>Times</servlet-name>
<servlet-class>edu.umassd.ecom.Times</servlet-class>
<servlet-name>Availability</servlet-name>
<servlet-class>edu.umassd.ecom.Availability</servlet-class>
<servlet-name>Confirmation</servlet-name>
<servlet-class>edu.umassd.ecom.Confirmation</servlet-class>
<servlet-name>Cancellation</servlet-name>
<servlet-class>edu.umassd.ecom.Cancellation</servlet-class>
<servlet-mapping>
<servlet-name>Movies</servlet-name>
<url-pattern>/Movies</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Dates</servlet-name>
<url-pattern>/Dates</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Times</servlet-name>
<url-pattern>/Times</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Availability</servlet-name>
<url-pattern>/Availability</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Confirmation</servlet-name>
<url-pattern>/Confirmation</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Cancellation</servlet-name>
<url-pattern>/Cancellation</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<ejb-ref>
<ejb-ref-name>ejb/MovielistFacadeBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.MovielistFacadeRemoteHome
edu.umassd.ecom.MovielistFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#MovielistFacadeBean</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/MovieinfoFacadeBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.MovieinfoFacadeRemoteHome
edu.umassd.ecom.MovieinfoFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#MovieinfoFacadeBean</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/MovieinfoFacadeBean1</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.MovieinfoFacadeRemoteHome
edu.umassd.ecom.MovieinfoFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#MovieinfoFacadeBean</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/MovieinfoFacadeBean2</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.MovieinfoFacadeRemoteHome
edu.umassd.ecom.MovieinfoFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#MovieinfoFacadeBean</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/CustomerFacadeBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.CustomerFacadeRemoteHome
edu.umassd.ecom.CustomerFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#CustomerFacadeBean</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/CustomerFacadeBean1</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
edu.umassd.ecom.CustomerFacadeRemoteHome
edu.umassd.ecom.CustomerFacadeRemote
<ejb-link>MovieTicketReservation-EJBModule.jar#CustomerFacadeBean</ejb-link>
</ejb-ref>
</web-app>
jboss-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain flushOnSessionInvalidation="false"/>
<context-root>/MovieTicketReservation-WebModule</context-root>
</jboss-web>
Please help me with this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041170#4041170
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041170
17 years, 8 months
[Tomcat, HTTPD, Servlets & JSP] - Comet
by MartyL
I've been looking for a comet implementation to support my webapp running in JBoss 4.0.3sp1. I finally found a servlet implementation called comet in Tomcat 6.0. I then discovered that JBoss 4.2 integrates Tomcat 6.0. While mulling that over, I finally glanced at Seam to see what it was all about, and it seems from my cursory look, to mention all the RIA buzzwords.
So... not wanting to re-invent the wheel (especially since mine are never quite as round), can I find a comet-like solution in JBoss 4.2/Seam?
Basically what I want, is if a user is logged on to my app and there is a data change by another user that affects the first user's UI, I want to push that change out to them.
Perhaps I should be posting in the Seam forum, but I was hoping to catch the attention of someone whao has used the Tomcat comet servlet in JBoss.
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041164#4041164
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041164
17 years, 8 months
[EJB 3.0] - Persisiting Related Objects with CMP
by abhinav19
Your help is needed with entity beans when cascading the persist operation for related objects.
There are two entities User & UserDetails related in one to one fashion. When I deploy the entity beans it adds an extra column as USERDETAIL RAW(255) in the DB. The DB is Oracle 10g XE. since th size of the usedetail object is more than 255 it does not insert the object. When I increased the size of the column to a large value it does not insert the record in the userdetail table.
Is there any setting in Jboss? I have just added the extra jars for EJB3 support. The application deploys cleanly.
I generated the entities using the net beans. The same problem persists.
Abhinav
The user entity is as follows...
package org.integral.ats.vertebrae.ejb.user;
|
| import java.io.Serializable;
| import java.util.Date;
|
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.OneToOne;
| import javax.persistence.PersistenceProperty;
| import javax.persistence.PrimaryKeyJoinColumn;
| import javax.persistence.Table;
| import javax.persistence.Temporal;
| import javax.persistence.TemporalType;
|
| @Entity
| @Table(name="tusr")
| public class User implements Serializable
| {
|
| private static final long serialVersionUID = 1L;
|
| @Id
| @GeneratedValue
| @Column(name="USR_ID")
| private long userID;
|
| @Column(name="USR_LGN_ID")
| private String userLoginID;
|
| @Column(name="USR_ROLE_ID")
| private String userRoleID;
|
| @Column(name="LST_LGN_TS" )
| @Temporal(value = TemporalType.DATE)
| private Date lastLoginDate;
|
| @Column(name="USR_ADD_INF" )
| private String userAddInfo;
|
| @Column(name="CRTD_TS")
| @Temporal(value = TemporalType.DATE)
| private Date creationDate;
|
| @Column(name="CRTD_USR")
| private long createdByUser;
|
| @Column(name="UPDT_TS" )
| @Temporal(value = TemporalType.DATE)
| private Date updatedDate;
|
| @Column(name="UPDT_USR")
| private long updatedByUser;
|
| @OneToOne(cascade={CascadeType.ALL})
| @PrimaryKeyJoinColumn
| private UserDetail userDetail;
|
| public static long getSerialVersionUID() {
| return serialVersionUID;
| }
|
| public UserDetail getUserDetail()
| {
| return userDetail;
| }
|
| public void setUserDetail(UserDetail userDetail)
| {
| this.userDetail = userDetail;
| }
|
| // getters & setters for other fields
| }
|
The UserDetail is as follows
package org.integral.ats.vertebrae.ejb.user;
|
| import java.io.Serializable;
| import java.util.Date;
|
| import javax.persistence.Basic;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| @Entity
| @Table(name="tusrdtl")
| public class UserDetail implements Serializable
| {
|
| private static final long serialVersionUID = 1L;
|
| @Id
| @GeneratedValue
| @Column(name="USR_ID")
| private long userID;
|
| @Column(name="USR_FST_NM")
| private String firstName;
|
| @Column(name="USR_MDL_NM")
| private String middleName;
|
| @Column(name="USR_LST_NM")
| private String lastName;
|
| @Column(name="USR_DOB")
| private Date dateOfBirth;
|
| @Column(name="USR_PWD" )
| private String password;
|
| @Column(name="USR_LST_PWD_CHNG_TS")
| private Date lastPasswordChangeDate;
|
| @Column(name="USR_PWD_CHNG_FREQ")
| private int passwordChangeFreq;
|
| @Basic
| @Column(name="CRTD_TS")
| private Date creationDate;
|
| @Basic
| @Column(name="CRTD_USR")
| private long createdByUser;
|
| @Column(name="UPDT_TS")
| private Date updatedDate;
|
| @Column(name="UPDT_USR")
| private long updatedByUser;
|
|
| public static long getSerialVersionUID() {
| return serialVersionUID;
| }
|
| public long getCreatedByUser() {
| return createdByUser;
| }
| public void setCreatedByUser(long createdByUser) {
| this.createdByUser = createdByUser;
| }
|
| // getter & setter for other properties
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041155#4041155
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041155
17 years, 8 months