[JBoss Seam] - Re: [2.0 beta1 CVS]SeamTest RARDeployment question
by enzhao
Got it! I messed up things from the CVS snapshot and the CVS. Here are things which should be fixed for CVS Snapshot:
1. The pom.xml under the /ui is missing in the Snapshot.
2. Three very important .rar files are missing in the Snapshot, under the folder bootstrap/deploy/. They are: jboss-local-jdbc.rar, jboss-xa-jdbc.rar, and jms-ra.rar. Without these three files the SeamTest using embedded microcontainer does not work.
3. antlr-3.0b7.jar should be used in the seam-gen generated file .classpath, instead of antlr-2.7.6.jar. Without correcting this I got a runtime exception saying some method was not found in this package. And I guess antlr-2.7.6.jar can be removed from the lib folder.
If these three things are corrected for the CVS snapshot, then the latest snapshot is finally usable.
Best Regards,
Ellen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057872#4057872
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057872
18Â years, 10Â months
[JBoss Seam] - How to create hibernate criteria
by knuwu
Hi
I like to create a hibernate criteria instead a normal query.
| @PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| public void search()
| {
| log.info("Get all users");
|
| Criteria c = ((Session)em.getDelegate()).createCriteria(User.class)
| .setMaxResults(this.pageSize)
| .addOrder(Order.asc("userid"));
|
| if (user.getUserid() != null && user.getUserid().length() > 0) {
| c.add(Restrictions.like("userid", user.getUserid() + "%"));
| }
|
| this.userList = c.list();
|
I always get an ClassCastException for the Session.
| Caused by: java.lang.ClassCastException: org.hibernate.ejb.EntityManagerImpl
| at com.swisscom.seat.modules.base.admin.UserManagerBean.search(UserManagerBean.java:132)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| ...
| ...
|
How can one get the Hiberate Session to create a criteria?
Im using a standard seam 1.2.1 configuration generated by seam-gen.
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057865#4057865
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057865
18Â years, 10Â months