-
1. Re: UserImpl not mapped
pedrosacosta Apr 21, 2006 6:34 AM (in response to pedrosacosta)instead of putted is put. :D
-
2. Re: UserImpl not mapped
cpage Apr 21, 2006 7:17 AM (in response to pedrosacosta)why don't use the UserModule ?
-
3. Re: UserImpl not mapped
pedrosacosta Apr 21, 2006 7:33 AM (in response to pedrosacosta)Thanks for the quick advice. Now it works.
-
4. Re: UserImpl not mapped
pedrosacosta Apr 21, 2006 10:35 AM (in response to pedrosacosta)No it doesn't work. :(
1 - Can you put an example that works?
2 - Should i start a service before doing findUserByUserName?UserModule mod = new UserModuleImpl(); User user = mod.findUserByUserName(username);
I'm asking this question because this snippet gives me the following error:java.lang.NullPointerException at org.jboss.portal.core.impl.user.UserModuleImpl.getCurrentSession(UserModuleImpl.java:372) at org.jboss.portal.core.impl.user.UserModuleImpl.findUserByUserName(UserModuleImpl.java:116) at com.link.portal.dao.PortalDAOBean.getUserByUserName(PortalDAOBean.java:220) 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.invocation.Invocation.performCall(Invocation.java:345) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
And i saw that UserImpl as a protected method startservice.
The mssql-ds.xml are well configurated.
Thanks,
Pedro -
5. Re: UserImpl not mapped
pedrosacosta Apr 21, 2006 12:05 PM (in response to pedrosacosta)To solve this problem do this:
UserModule mod = (UserModule) new InitialContext().lookup("java:portal/UserModule");
-
6. Re: UserImpl not mapped
cpage Apr 21, 2006 12:48 PM (in response to pedrosacosta)i think you can inject the service in the portlet :
in jboss-portlet.xml:<service> <service-name>UserModule</service-name> <service-class>org.jboss.portal.core.modules.UserModule</service-class> <service-ref>:service=Module,type=User</service-ref> </service>
and get the usermodule in the portlet :userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-
7. Re: UserImpl not mapped
julien1 Apr 27, 2006 5:14 PM (in response to pedrosacosta)yes this saves a JNDI lookup :-)
"cpage" wrote:
i think you can inject the service in the portlet :
in jboss-portlet.xml:<service> <service-name>UserModule</service-name> <service-class>org.jboss.portal.core.modules.UserModule</service-class> <service-ref>:service=Module,type=User</service-ref> </service>
and get the usermodule in the portlet :userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-
8. Re: UserImpl not mapped
abuayyub Jun 22, 2006 8:38 AM (in response to pedrosacosta)Hi,
You may know this already but as i have just hit it myself i thought i'd mention this anyway. make sure that you are using stateful session beans with the EntityManager for multiple calls to beans. the annotation should be something like this:@PersistenceContext(unitName="myEjb", type=PersistenceContextType.EXTENDED).
TheQuerySyntaxException: myEjb not mapped
occurs because the injected persistence manager is closed once a stateless been is returned to the pool.
regards abuayyub -
9. Re: UserImpl not mapped
requiem2460309 Dec 6, 2006 6:41 PM (in response to pedrosacosta)"pedrosacosta" wrote:
instead of putted is put. :D
instead of using the name of table in query string you
must use the name of class being mapped -
10. Re: UserImpl not mapped
thanvi Dec 18, 2006 5:07 AM (in response to pedrosacosta)Hi
I am tryign to connect to UserModule using the JNDI anme /portal/UserModule. Its throwing the excpetion.
I need to connect to userModule from my plain java class. How to go about it.
I have tried the followig
UserModule mod = (UserModule) new InitialContext().lookup("java:/portal/UserModule");
It gives the following error
org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:541)
at org.jboss.portal.identity.db.UserModuleImpl.getCurrentSession(UserModuleImpl.java:327)
at org.jboss.portal.identity.db.UserModuleImpl.getUserCount(UserModuleImpl.java:304)
at com.reuters.lipper.dwr.UserDAO.countUsers(UserDAO.java:49)
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:324)
at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239)
at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48)
at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:81)