NullPointerException at doSecondPass
by Heping Zhang
hi, I deployed my app to jboss, but something wrong happen:
2007-05-18 22:16:57,843 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper]
Starting failed persistence.units:ear=favorites.ear,jar=favoritesEJB.jar
,unitName=favorites
java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(
OneToOneSecondPass.java:135)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java
:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(
AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar
,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=UserSiteFacade,service=EJB3
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar
,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar
,name=UserSiteFacade,service=EJB3
here is my code:
@Entity
@Table(name = "users", catalog = "favorites", uniqueConstraints = {})
public class Users implements java.io.Serializable {
private Set<UserSite> userSites = new HashSet<UserSite>(0);
//...
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy
= "users")
public Set<UserSite> getUserSites() {
return this.userSites;
}
public void setUserSites(Set<UserSite> userSites) {
this.userSites = userSites;
}
}
@Entity
@Table(name = "user_site", catalog = "favorites", uniqueConstraints = {})
public class UserSite implements java.io.Serializable {
private Users users;
//...
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "userId", unique = false, nullable = false, insertable =
true, updatable = true)
public Users getUsers() {
return this.users;
}
public void setUsers(Users users) {
this.users = users;
}
}
any advise?
18 years, 11 months
[Installation, Configuration & Deployment] - Re: basic 4.2 deploy and missing javax.servlet files
by wiggy
so nearly there.
went to site mentioned at download the org.eclipse.jst.server.jboss.ejb3_1.5.0.v200705171400.jar file which turns out to be a zip file. Heigh ho, i went into my eclipse plugins and created a dir with the same name as the zip file. I then extracted the zip file into the directory just created and restart eclipse - clean.
brilliant now i get the extra server defns. I created a new 4.2 server and start it - it comes up clean. wonderful.
Then i have a problem. I create a new dynamic web project and point it at the new server. it fails to compile with errors
anonymous wrote :
| Severity and Description Path Resource Location Creation Time Id
| Project my is missing required library: 'E:\jboss\jboss-4.2.0.GA\client\javax.servlet.jar' my Build path 1179529310630 2006
| Project my is missing required library: 'E:\jboss\jboss-4.2.0.GA\server\default\lib\javax.servlet.jsp.jar' my Build path 1179529310630 2005
|
the libraries are pointed to the wrong named files.
when i open the project and look at the build library paths i get the following
jboss runtimes (wst:2.4) which if you open it shows the javax.servlet.jsp.jar, and javax.servlet.jar - which are not the latest names in the 4.2 files list.
I dont know where this bit of config is to change it. If you try and edit the runtimes section it shows
anonymous wrote :
| org.jboss.ide.eclipse.as.core.runtime.ProjectInitializer/JBOSS 4.2 EJB3/jst.web/2.4
|
where is this?
very close but not quite there. I thought it might be in the serverdef file in the plugins dir however that correctly shows
anonymous wrote :
|
|
|
|
|
| <!--JBoss specific annotations like "SecurityDomain". -->
|
|
|
| <!--The J2EE5 AppClient needs more JARs for startup-->
| <!-- -->
|
|
|
| <!--Hibernate Exceptions might come into the application client. For catching them we need this jar.
| -->
|
| <!--For usage of Hibernate those JARs might be required -->
|
|
|
|
|
|
|
|
|
|
with the new files correct
any ideas???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046957#4046957
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046957
18 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - NullPointerException at doSecondPass
by phoenix.zhp
hi, I deployed my app to jboss, but something wrong happen:
2007-05-18 22:16:57,843 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3
here is my code:
@Entity
@Table(name = "users", catalog = "favorites", uniqueConstraints = {})
public class Users implements java.io.Serializable {
private Set userSites = new HashSet(0);
//...
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "users")
public Set getUserSites() {
return this.userSites;
}
public void setUserSites(Set userSites) {
this.userSites = userSites;
}
}
@Entity
@Table(name = "user_site", catalog = "favorites", uniqueConstraints = {})
public class UserSite implements java.io.Serializable {
private Users users;
//...
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "userId", unique = false, nullable = false, insertable = true, updatable = true)
public Users getUsers() {
return this.users;
}
public void setUsers(Users users) {
this.users = users;
}
}
any advise?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046955#4046955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046955
18 years, 11 months
[JBoss Seam] - Re: Test EJB3/Seam from eclipse
by jfrankman
I will answer my own question concerning my "emf = Persistence.createEntityManagerFactory("myResourceLocalEntityManager");" question.
I just had to define the persistence-unit in a persistence.xml file.
<persistence-unit name="sample">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <class>com.idfbins.nexus.common.vo.busent.FBWorker</class>
| <properties>
| <property name="hibernate.connection.driver_class" value="com.ibm.db2.jcc.DB2Driver"/>
| <property name="hibernate.connection.username" value="db2admin"/>
| <property name="hibernate.connection.password" value="db2admin"/>
| <property name="hibernate.connection.url" value="jdbc:db2://nexusdbtest:50001/nxsprot1"/>
| <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
|
| </properties>
| </persistence-unit>
If I understand this correctly, EJB3 requires the persistence.xml file to exist in the META-INF directory. Seam-gen creates three separate persistence files: persistence-dev.xml, persistence-test.xml, and persistence-prod.xml. It then copies one of these into the META-INF directory from the ANT build.
When I tried to place the persistence-unit into the persistence-*.xml files nothing worked. I am sure this could be fixed in the build.xml file.
But, for me to get this working from Eclipse I had to create a persistence.xml file and place it in the META-INF directory of my project. I then included the persistence-unit shown in the xml above. Also note that I had to declare the mapped class using the class tag "com.idfbins.nexus.common.vo.busent.FBWorker
". I do not know if I have to do this for every mapped POJO or if there if I can just specify a package name and/or wildcard to define all mapped classes in my project.
These two links helped me figure this out:
http://trailblazer.demo.jboss.com/EJB3Trail/persistence/config/
http://www.censnet.it/articles/cap03.htm
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046954#4046954
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046954
18 years, 11 months
[EJB 3.0] - NullPointerException at doSecondPass
by phoenix.zhp
hi, I deployed my app to jboss, but something wrong happen:
2007-05-18 22:16:57,843 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:ear=favorites.ear,jar=favoritesEJB.jar,unitName=favorites
State: FAILED
Reason: java.lang.NullPointerException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AddressFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=AdminFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=CommentFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesDirectoryFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=FavoritesFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=PermissionFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=RoleFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=SiteFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=TagFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UsersFacade,service=EJB3
jboss.j2ee:ear=favorites.ear,jar=favoritesEJB.jar,name=UserSiteFacade,service=EJB3
here is my code:
@Entity
@Table(name = "users", catalog = "favorites", uniqueConstraints = {})
public class Users implements java.io.Serializable {
private Set userSites = new HashSet(0);
//...
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "users")
public Set getUserSites() {
return this.userSites;
}
public void setUserSites(Set userSites) {
this.userSites = userSites;
}
}
@Entity
@Table(name = "user_site", catalog = "favorites", uniqueConstraints = {})
public class UserSite implements java.io.Serializable {
private Users users;
//...
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "userId", unique = false, nullable = false, insertable = true, updatable = true)
public Users getUsers() {
return this.users;
}
public void setUsers(Users users) {
this.users = users;
}
}
any advise?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046953#4046953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046953
18 years, 11 months