[jboss-user] [EJB 3.0] - Entity bean @Post... lifecycle methods that call SLSB hang
JBoss AS 4.0.5.GA Hibernate Core 3.3.1.GA Hibernate EntityManager 3.4.0.GA MSSQL Server 2000 and 2005 (same symptom) Seam 1.2.1.GA The app runs fine with MySQL. If I have an entity bean method annotated with @PostPersist, @PostUpdate or @PostRemove and that method calls an SLSB the method invocation hangs when using MSSQL. It works fine with MySQL. Execution never hits a breakpoint I set in the target SLSB method. It is not the method that is hanging it it the invocation of the method (so it seems). I am not certain if this is Seam related or not. I have no quick way to remove Seam from the app. Anyone seen this before? Happens on multiple entity beans. Those with @postUpdate (for example) do not hang if they do not have an SLSB call! Weird. May be a transaction deadlock View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4181900#4181900 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4181900 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Entity Bean Package Modification (javax.persistence.Persiste
Hi, I have changed Entity bean package to another, but jboss server is still looking for for old package and giving "class or package not found" exception. I have changed com.atosorigin.utils.pojo.PrStaff to com.atosorigin.utils.ejb.PrStaff, but server is still searching for old package. 15:01:15,327 WARN [ServiceController] Problem starting service persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context javax.persistence.PersistenceException: [PersistenceUnit: time_report_persistence_context] class or package not found at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1092) . . Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.atosorigin.utils.pojo.PrStaff at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212) at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521) 15:01:15,640 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,656 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrGroupsHome,service=EJB3 with dependencies: 15:01:15,656 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,656 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,656 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrLocationHome,service=EJB3 with dependencies: 15:01:15,656 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,672 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,672 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrProjectHome,service=EJB3 with dependencies: 15:01:15,672 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,703 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,703 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrProjectTaskHome,service=EJB3 with dependencies: 15:01:15,703 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,703 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,703 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrStaffHistoryHome,service=EJB3 with dependencies: 15:01:15,750 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,750 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,750 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrStaffHome,service=EJB3 with dependencies: 15:01:15,750 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,765 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,765 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrTeamsHome,service=EJB3 with dependencies: 15:01:15,797 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,797 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,797 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrVacationCompensationHome,service=EJB3 with dependencies: 15:01:15,797 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,797 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,812 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=surgeonfish.ear,jar=surgeonfish.jar,name=PrVacationHome,service=EJB3 with dependencies: 15:01:15,812 INFO [JmxKernelAbstraction] persistence.units:ear=surgeonfish.ear,jar=surgeonfish.jar,unitName=time_report_persistence_context 15:01:15,812 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer 15:01:15,812 INFO [JmxK
[jboss-user] [EJB 3.0] - entity bean
when iam deploying entity bean it is deployed sucessfully when i enter ant run at the command prompt it is generating error run: [java] Exception in thread "main" javax.naming.NameNotFoundException: remot e not bound [java] at org.jnp.server.NamingServer.getBinding(NamingServer .java:529) [java] at org.jnp.server.NamingServer.getBinding(NamingServer .java:537) [java] at org.jnp.server.NamingServer.getObject(NamingServer. java:543) [java] at org.jnp.server.NamingServer.lookup(NamingServer.jav a:296) [java] at org.jnp.server.NamingServer.lookup(NamingServer.jav a:270) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeM ethodAcces sorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Del egatingMet hodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:597) [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastSer verRef.jav a:305) [java] at sun.rmi.transport.Transport$1.run(Transport.java:15 9) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at sun.rmi.transport.Transport.serviceCall(Transport.j ava:155) [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(T CPTranspor t.java:535) [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandle r.run0(TCP Transport.java:790) [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandle r.run(TCPT ransport.java:649) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runT ask(Thread PoolExecutor.java:885) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPool Executor.java:907) [java] at java.lang.Thread.run(Thread.java:619) [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceive dFromServe r(StreamRemoteCall.java:255) [java] at sun.rmi.transport.StreamRemoteCall.executeCall(Stre amRemoteCa ll.java:233) [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:14 2) [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source) [java] at org.jnp.interfaces.NamingContext.lookup(NamingConte xt.java:62 5) [java] at org.jnp.interfaces.NamingContext.lookup(NamingConte xt.java:58 7) [java] at javax.naming.InitialContext.lookup(InitialContext.j ava:392) [java] at x.Client.main(Client.java:12) [java] Java Result: 1 BUILD SUCCESSFUL Total time: 3 minutes 42 seconds D:\software\jayendra\EJB\EntityBean>ant clean Buildfile: build.xml clean: [delete] Deleting directory D:\software\jayendra\EJB\EntityBean\build [delete] Deleting: D:\Program Files\jboss-4.0.5.GA\server\default\deploy\Ent. jar BUILD FAILED D:\software\jayendra\EJB\EntityBean\build.xml:85: Unable to delete file D:\Progr am Files\jboss-4.0.5.GA\server\default\deploy\Ent.jar Total time: 2 seconds View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133667#4133667 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133667 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - entity bean to a view?
Is it possible to map an entity bean to a view and if so how - currently when i do this I get the following during deployment of the EAR file to JBOSS: | ObjectName: persistence.units:ear=fraud-ear-1.0-SNAPSHOT.ear,jar=fraud-ejb-1.0-SNAPSHOT.jar,unitName=fraud | State: FAILED | Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing table: tst | Where tst is a view. It seems to be only looking for tables - Is this configurable? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092220#4092220 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092220 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Entity bean with compound PK containing FK
It looks like the EJB3 spec does not support an entity bean with a FK as part of its compound PK. I've managed to find JBoss/hibernate docs which describe their work around for the problem, and I've managed to get that to work. The last hurdle that I can't figure out is how to map the reverse association. It looks like the ManyToOne in the Embedded PK isn't actually part of the EntityBean and so I can't reference it in the mapped by clause from the associated Entity Bean. Abbreviated table structure is as follows: tblParent parentId (PK) ... tblChild parentId (FK) (PK) sequence (PK) ... Very Abbreviated Entities as follows: @Entity public class ParentBean { ... /** HOW SHOULD I ANNOTATE THIS **/ @OneToMany(mappedBy="parent") <-- DOESNT WORK @OneToMany(mappedBy="pk.parent") <-- DOESNT WORK public Set< ChildBean > getChildren(); public void setChildren(Set< ChildBean > children); ... } @Entity @AssociationOverride( name="pk.parent", joinColumns = @JoinColumn(name="parent_parentId") ) public class ChildBean { @EmbeddedId public ChildPK pk; } @Embeddable public class ChildPK { @ManyToOne public ParentBean parent; public Integer sequence; } View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972208#3972208 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972208 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - entity bean list
Hello! I'm wondering, If there is a possibility to obtain list of all found entity beans within ear application. I need to retrieve such information from within session bean. Is there any service which might be helpfull in this case? regards Micha? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963753#3963753 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963753 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Entity Bean custom functions - asText(), createfromwkt()
Hi, I have written entity beans that map on to the columns of a spatial database (postgis) so I have a property @Column(name="extents") public String getExtents() { return extents; } where extents is actually of type Geometry but I want JBoss to call the database astext() function wrapper when retrieving this column, and when it updates the entity to call the database createfromwkt() function. Is this possible with EJB3? Ideally I would also likes these functions to be available when using EJB-QL? Many thanks, Norman View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963618#3963618 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963618 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - entity bean name in ejb3 RC7
Hello! I have just migrated from JBoss4.0.3, EJB3 RC3 to JBoss 4.0.4, EJB3 RC7. My EAR project consists of two packages: logic.jar (previously .ejb3) with SLSB & SFSB, and data.jar (previously .par) with entity beans. After consulting wiki EJB migration guide, I deployed application to new server. When I try to execute following query: SELECT u FROM User AS u WHERE u.login= :login I got the following exception: | javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [SELECT u FROM User AS u where u.login = :login] | Which is strange, as User should be the enity bean name by the specification. When I put fully qualified name of the entity: SELECT u FROM myPackage.User AS u WHERE u.login= :login I got | javax.persistence.PersistenceException: org.hibernate.HibernateException: could not locate named parameter [login] | User entity is defined as: | package myPackage; | @Entity | @Table(name = "APPLICATION_USERS") | public class User implements Serializable | { | ... | private String login; | @Column(name = "USERNAME", nullable = false, unique = true) | public String getLogin() | { | return this.login; | } | | public void setLogin(String login) | { | this.login = login; | } | } | persistence.xml is defined as: | | http://java.sun.com/xml/ns/persistence"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"; | version="1.0"> | | java:/MyDS | | | | | | | I have put it into logic and data jars. Am I missing something? regards Micha? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963374#3963374 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963374 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Entity bean passed through a session bean and into the UI! S
I would like professional advice on a good design pattern when using EJB3(session and entity). We have been having this debate at work about not using entity bean in the client and only allowing a session bean to access the entity beans. I had to take in my textbook(Beginning Java EE 5) to substantiate my claim that using the EB in the UI is not a good idea. However the decision has now went in favour of using common objects(previously EB) in the front end and passing them into the session bean which can then be marked with the @embeddable annotation and persisted by an entity bean? What are you're views and thoughts on this? What is a good design pattern to follow that will allow scalability as well as being quick to implement? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962607#3962607 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962607 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Entity bean state not rolled back on TX rollback:
I have an entity bean with a "id" property annotated by: | @Id | @GeneratedValue | However, when this transaction fails with a database level deadlock and is rolled back (ie: EJBTransactionRolledbackException ...), the entity's "id" property is not rolled back and still has the database generated id value that it was given before the deadlock. So it essentially becomes a detached entity with no real backing value in the database. Shouldn't an entity bean's state be rolled back as well when the application TX is rolled back? Is this a bug? The rollback is initiated by a database deadlock and is described by the following exception stack: | javax.ejb.EJBTransactionRolledbackException | javax.persistence.PersistenceException | org.hibernate.exception.LockAcquisitionException: could not insert: ... | java.sql.SQLException: Deadlock found when trying to get lock; try restarting transaction | Let me know if you need more information to reproduce/investigate this... Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957915#3957915 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957915 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user