[EJB 3.0] - Illegalargumentexception on calling namedquery
by aukenoppe
Hi,
i have a entitybean user, which has a namedquery User.getAllUsers.
when i call this query from my sessionbean:
Query q = getEm().createNativeQuery("SELECT object(u) FROM User u WHERE "
| + col + " LIKE :value", User.class).setParameter("value", value);
or the namedquery
| @NamedQuery(name = "User.getAllUsers", query = "SELECT u FROM User u"):
|
then i get this stack from the client progam:
xception in thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: wrong number of arguments
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:337)
| at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:320)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at
| org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
the serverstack is as follows:
| 13:09:37,421 ERROR [STDERR] java.lang.IllegalArgumentException: wrong number of arguments
| 13:09:37,421 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| 13:09:37,421 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| 13:09:37,421 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| 13:09:37,421 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:514)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:66)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:49)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.create(ThreadlocalPool.java:50)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:90)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:315)
| 13:09:37,421 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:320)
| 13:09:37,421 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| 13:09:37,421 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| 13:09:37,421 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| 13:09:37,421 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| 13:09:37,421 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| 13:09:37,421 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
does anyone has one idea about what i'm doing wrong?
Regards
Auke Noppe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154993#4154993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154993
16 years, 7 months
[JBoss Portal] - Re: What exactly is the point of JBoss portal
by chris.laprun@jboss.com
Thanks je.a.le for answering!
Some more answers and precisions:
1) A portal server is NOT a servlet container. A servlet containers can work with any kind of web application. A portal is a combination of a portlet container and a user facing web application. Portlets are special web applications designed to run in a portal environment to which they delegate many responsibilities. It is therefore easier to create a portal-based application based on portlet components that are integrated into a unified interface.
2) If you are interested in portals, you should read the portlet specifications (Portlet 1.0 is JSR 168, Portlet 2.0 is JSR 286). They explain what a portlet is and how they interact with portals.
3) Any portal server provides the glue and services that allow your portlets to focus on their responsibilities. In particular, any portal server will take care of rendering your portlets on pages, user identification, security, etc.
4) There are many instances of sites running JBoss Portal. However, many of them are in an enterprise setting and not publicly available. You can see a live demo site running JBoss Portal at http://portal.demo.jboss.com/. Note also that jboss.org runs on JBoss Portal. :)
5) Yes. However, it is very often the case that people develop their own portlets so that they can suit their needs better. Contributing such portlets back to the community is always encouraged! ;)
6) Middle-sized website doesn't mean much. It's difficult to answer such a question abstractly as it will mostly depend on the portlets that are deployed.
If you require more help, Red Hat offers training and consulting services.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154992#4154992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154992
16 years, 7 months