[EJB 3.0] - Re: Need some help with mapping
by MikeDougherty
Yeah, you are right. I think the primary key in this case is breaking a few rules. I think one column in this case would be sufficient, but being an application developer and not a database developer, what do I know. I will make some effort to push back (if even possible). But for now I need to keep trudging ahead.
So.... changing the mapping to @ManyToOne did not seem to have the desired effect.
| State: FAILED
| Reason: org.hibernate.AnnotationException: A Foreign key refering com.foo.entities.Type from com.foo.entities.Store has the wrong number of column. should be 3
|
| @ManyToOne
| @JoinColumn(name="STORE_TYPE", referencedColumnName = "TYPE_ID")
| public Type getStoreType() {
| return storeType;
| }
|
You had multiple JoinColumns in your earlier post. But the STORE table doesn't have a TABLE_NAME column in it. So how do I map that column of the TypePK class to a static value? I would like to try something like the following, but I don't think this will work the way it is.
| @ManyToOne
| @JoinColumn(name="STORE_TYPE", referencedColumnName = "TYPE_ID")
| @DiscriminatorColumn(name="TABLE_NAME", discriminatorType=STRING,length=20)
| @DiscriminatorValue("STORE")
| @DiscriminatorColumn(name="FIELD_NAME", discriminatorType=STRING,length=20)
| @DiscriminatorValue("STORE_TYPE")
| public Type getStoreType() {
| return storeType;
| }
|
But I believe @DiscriminatorColumn and @DiscriminatorValue are class level annotations, not method level. Is that a correct assumption? If so, is there a way to get the results of those annotations another way?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035098#4035098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035098
19 years
[Beginners Corner] - JBOSS does not respond!!!!!
by shardul.bhatt
HI,
I am developing an application using Java, Spring, Struts 2 and Hibernate.
I have deployed it in JBoss 4.0.2
I have configured a class which extends the javax.servlet.ServletContextListener and it starts a thread when the server starts. The thread initialises a small application(say App1) which creates a socket connection with another application(say App2) running on the same machine but outside JBoss. App1 is initialised properly and it also makes the socket connection with App2 and the applications(App1 <--> App2) start polling. So basically App1 and App2 establish their own session. App1 now waits for user input. The user input is given from the Main Web Application (say App3) which contains App2.
Now when I try to access the Login Page of App3 which is the web application and App2 is a part of App3 the login page does not show. There is no error trace on the JBoss console or in the browser.
Can someone please tell me what could be the problem? Am I trying to do something fundamentally wrong?
Thanks in advance.
Best Regards,
Shardul.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035095#4035095
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035095
19 years
[JBoss Seam] - Re: Trinidad PPR/Ajax and Seam
by chane
"dajevtic" wrote : By the way. Please remember that the Listener only checks if the action source is of type "CoreCommandLink"!
| If you also use a "CoreCommandButton" or a somewhere then you must add the check for this instance as well, or just use the super class UIXCommand.
| I'm not 100% sure, but if you want to make inputListOfValues work for conversation scope, you might have to add functionality for this as well, but I'll check this out this weekend, too!
|
dj,
Thanks for the replies. That what help me get started. I look forward to looking at anything you can put together this weekend if you get the chance. It's always nice to learn from someone who has been through it before rather then re-invent the wheel.
Thanks again,
Chris....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035089#4035089
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035089
19 years
[EJB 3.0] - deploy a stateful session bean 3.0
by shupingChen
When I run the stateful session bean example in the tutorial of jboss-EJB-3.0_RC9_Patch_1, I encountered a problem: the client throws errors:
Instantiating beans...
| 23:58:00,734 ERROR [SocketClientInvoker] Got marshalling exception, exiting
| java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
| at java.net.URLClassLoader$1.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
| at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
| at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
| at java.io.ObjectInputStream.readClassDesc(Unknown Source)
| at java.io.ObjectInputStream.readArray(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
| at java.io.ObjectInputStream.readExternalData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
| at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
| at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
| at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
| at org.jboss.remoting.Client.invoke(Client.java:525)
| at org.jboss.remoting.Client.invoke(Client.java:488)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
| at $Proxy0.createProxy(Unknown Source)
| at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
| at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
| at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
| at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at examples.session.stateful.CountClient.main(CountClient.java:26)
| 23:58:00,765 ERROR [SocketClientInvoker] Error loading classes from remote call result.
| java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
| at java.net.URLClassLoader$1.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
| at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
| at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
| at java.io.ObjectInputStream.readClassDesc(Unknown Source)
| at java.io.ObjectInputStream.readArray(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
| at java.io.ObjectInputStream.readExternalData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
| at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
| at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
| at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
| at org.jboss.remoting.Client.invoke(Client.java:525)
| at org.jboss.remoting.Client.invoke(Client.java:488)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
| at $Proxy0.createProxy(Unknown Source)
| at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
| at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
| at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
| at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at examples.session.stateful.CountClient.main(CountClient.java:26)
| javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
| at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at examples.session.stateful.CountClient.main(CountClient.java:26)
| Caused by: java.lang.reflect.UndeclaredThrowableException
| at $Proxy0.createProxy(Unknown Source)
| at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
| at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
| at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
| at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
| ... 4 more
| Caused by: java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
| at java.net.URLClassLoader$1.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
| at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
| at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
| at java.io.ObjectInputStream.readClassDesc(Unknown Source)
| at java.io.ObjectInputStream.readArray(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
| at java.io.ObjectInputStream.readExternalData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
| at java.io.ObjectInputStream.readSerialData(Unknown Source)
| at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
| at java.io.ObjectInputStream.readObject0(Unknown Source)
| at java.io.ObjectInputStream.readObject(Unknown Source)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
| at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
| at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
| at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
| at org.jboss.remoting.Client.invoke(Client.java:525)
| at org.jboss.remoting.Client.invoke(Client.java:488)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035078#4035078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035078
19 years