[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
As I posted, it works now, but with @JoinColumn. I think that there was something wrong in RC3 with referencedColumnName in @JoinColumn. That's why I didn't use it and that's why it surprised me to work now. Anyway, hopefully there will be no more big changes in final release and I will not have to change my code drastically. If you have time for one last question: What's the difference between @PrimaryKeyJoinColumn and @JoinColumn? Sorry if this is stupid (then forget it), but I don't understand when to use @PrimaryKeyJoinColumn. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921515#3921515 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921515 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
Got it to work. @PrimaryKeyJoinColumn didn't do the job here. I've put @JoinColumn back. Someone may laugh, but I forgot to remove referencedColumnName, and that actually did the trick. It looks like that was the problem all along. Now there are no exceptions on deployment. If only I can make finders work... But that's another story, and probably I'll manage to do it today. Bill and Mooktarus, thank you for all the replies. This is new technology and it requires probably more polishing and even more documenting, but keep up the good work. If you ever come to Novi Sad, Serbia, you'll get a bottle of finest Serbian ?ljivovica (plum brandy) :-) Thank you again. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921420#3921420 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921420 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
I've tried it,and still nothing. I've replaced @JoinColumn with @PrimaryKeyJoinColumn (JBossIDE shows the error, but I do the packaging anyway). Now Edition entity looks like this: package com.gint.scm.ejb.entity; | | import java.io.Serializable; | import java.util.Collection; | | import javax.persistence.AttributeOverride; | import javax.persistence.AttributeOverrides; | import javax.persistence.CascadeType; | import javax.persistence.Column; | import javax.persistence.EmbeddedId; | import javax.persistence.Entity; | import javax.persistence.FetchType; | import javax.persistence.ManyToOne; | import javax.persistence.OneToMany; | import javax.persistence.PrimaryKeyJoinColumn; | import javax.persistence.PrimaryKeyJoinColumns; | import javax.persistence.Table; | | import org.jboss.annotation.ejb.Local; | | @SuppressWarnings("serial") | @Entity | @Local | @Table(name = "edition") | public class Edition implements Serializable { | private EditionPK editionPK; | | private Organisation organisation; | | private Version version; | | private Collection editionAnnotations; | | @EmbeddedId | @AttributeOverrides( { | @AttributeOverride(name = "versionMark", column = @Column(name = "versionMark")), | @AttributeOverride(name = "applicationId", column = @Column(name = "applicationId")), | @AttributeOverride(name = "organisationId", column = @Column(name = "organisationId")) }) | public EditionPK getEditionPK() { | return editionPK; | } | | public void setEditionPK(EditionPK editionPK) { | this.editionPK = editionPK; | } | | @ManyToOne | @PrimaryKeyJoinColumn(referencedColumnName="id", name = "organisationId") | public Organisation getOrganisation() { | return organisation; | } | | public void setOrganisation(Organisation organisation) { | this.organisation = organisation; | } | | @ManyToOne | @PrimaryKeyJoinColumns( { | @PrimaryKeyJoinColumn(referencedColumnName = "versionMark", name = "versionMark"), | @PrimaryKeyJoinColumn(referencedColumnName = "applicationId", name = "applicationId") }) | public Version getVersion() { | return version; | } | | public void setVersion(Version version) { | this.version = version; | } | | public Edition(Organisation organisation, Version version) { | this.organisation = organisation; | this.version = version; | } | | public Edition() { | } | } | This is what gets thrown during deployment on RC5 (the same was on RC4): java.lang.reflect.InvocationTargetException | 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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:97) | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274) | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230) | 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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) | at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943) | at $Proxy0.start(Unknown Source) | at org.jboss.system.ServiceController.start(ServiceController.java:428) | at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
anonymous wrote : Neither. At least for me. | | JBossIDE says: | Code: | | The annotation @PrimaryKeyJoinColumns is disallowed for this location | Maybe it's because it is composite key (@EmbeddedId). View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921355#3921355 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921355 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
Neither. At least for me. JBossIDE says: The annotation @PrimaryKeyJoinColumns is disallowed for this location Also, Bill, do you know anything about the error in deployment,considering MySQL? Thanks for quick response. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921354#3921354 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921354 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
If no one knows why is this happening, can anyone tell me is there a real tutorial on composite primary keys. In this application I am trying to create primary key from foreign key and a string field (in Version entity), and then I'm using that key as a part of primary key in Edition entity. There are tutorials showing how to make PK class,but none shows how to solve this kind of problem. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921346#3921346 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921346 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
Thanks,but it didn't help. Here is the log of the deployment: 00:53:44,421 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=ApplicationFacadeBean, class=com.gint.scm.ejb.facade.ApplicationFacadeBean, type=STATELESS | 00:53:44,453 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=CityFacadeBean, class=com.gint.scm.ejb.facade.CityFacadeBean, type=STATELESS | 00:53:44,484 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=EditionFacadeBean, class=com.gint.scm.ejb.facade.EditionFacadeBean, type=STATELESS | 00:53:44,515 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=OrganisationFacadeBean, class=com.gint.scm.ejb.facade.OrganisationFacadeBean, type=STATELESS | 00:53:44,546 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=VersionFacadeBean, class=com.gint.scm.ejb.facade.VersionFacadeBean, type=STATELESS | 00:53:44,546 FATAL [PersistenceXmlLoader] apptracker JTA | 00:53:44,546 INFO [Ejb3Deployment] EJB3 deployment time took: 203 | 00:53:44,562 INFO [JmxKernelAbstraction] installing MBean: persistence.units:jar=SCMEJB.ejb3.jar,unitName=apptracker with dependencies: | 00:53:44,562 INFO [JmxKernelAbstraction] jboss.jca:name=MySqlDS,service=DataSourceBinding | 00:53:44,609 INFO [Ejb3Configuration] found EJB3 Entity bean: com.gint.scm.ejb.entity.Application | 00:53:44,609 INFO [Ejb3Configuration] found EJB3 Entity bean: com.gint.scm.ejb.entity.City | 00:53:44,609 INFO [Ejb3Configuration] found EJB3 Entity bean: com.gint.scm.ejb.entity.Edition | 00:53:44,609 INFO [Ejb3Configuration] found EJB3 @Embeddable: com.gint.scm.ejb.entity.EditionPK | 00:53:44,625 INFO [Ejb3Configuration] found EJB3 Entity bean: com.gint.scm.ejb.entity.Organisation | 00:53:44,625 INFO [Ejb3Configuration] found EJB3 Entity bean: com.gint.scm.ejb.entity.Version | 00:53:44,625 INFO [Ejb3Configuration] found EJB3 @Embeddable: com.gint.scm.ejb.entity.VersionPK | 00:53:44,687 INFO [AnnotationBinder] Binding entity from annotated class: com.gint.scm.ejb.entity.Application | 00:53:44,687 INFO [EntityBinder] Bind entity com.gint.scm.ejb.entity.Application on table application | 00:53:44,687 INFO [AnnotationBinder] Binding entity from annotated class: com.gint.scm.ejb.entity.City | 00:53:44,687 INFO [EntityBinder] Bind entity com.gint.scm.ejb.entity.City on table city | 00:53:44,734 INFO [AnnotationBinder] Binding entity from annotated class: com.gint.scm.ejb.entity.Edition | 00:53:44,734 INFO [EntityBinder] Bind entity com.gint.scm.ejb.entity.Edition on table edition | 00:53:44,750 INFO [AnnotationBinder] Binding entity from annotated class: com.gint.scm.ejb.entity.Organisation | 00:53:44,750 INFO [EntityBinder] Bind entity com.gint.scm.ejb.entity.Organisation on table organisation | 00:53:44,750 INFO [AnnotationBinder] Binding entity from annotated class: com.gint.scm.ejb.entity.Version | 00:53:44,750 INFO [EntityBinder] Bind entity com.gint.scm.ejb.entity.Version on table version | 00:53:44,765 INFO [CollectionBinder] Mapping collection: com.gint.scm.ejb.entity.Version.editions -> edition | 00:53:44,921 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider | 00:53:44,921 INFO [InjectedDataSourceConnectionProvider] Using provided datasource | 00:53:44,937 INFO [SettingsFactory] RDBMS: MySQL, version: 5.0.17-nt | 00:53:44,937 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.0.14-production ( $Date: 2004/04/24 15:49:43 $, $Revision: 1.27.2.39 $ ) | 00:53:44,937 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect | 00:53:44,937 INFO [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions) | 00:53:44,937 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup | 00:53:44,937 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup | 00:53:44,937 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled | 00:53:44,937 INFO [SettingsFactory] Automatic session close at end of transaction: disabled | 00:53:44,937 INFO [SettingsFactory] JDBC batch size: 15 | 00:53:44,937 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled | 00:53:44,937 INFO [SettingsFactory] Scrollable result sets: enabled | 00:53:44,937 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled | 00:53:44,937 INFO [SettingsFactory] Connection release mode: after_statement | 00:53:44,937 INFO [SettingsFactory] Maximum outer join fetch depth: 2 | 00:53:44,937 INFO [SettingsFactory] Default batch fetch size: 1 | 00:53:44,937 INFO [SettingsFactory] Generate SQL with comments: disabled | 00:53:44,937 INFO [SettingsFactory] Order SQL updates by primary key: disabled | 00:53:44,937 INFO [SettingsFactory] Query translator: o
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
Here is the example of the findAll() query: public List findAll() { | return (List) em | .createQuery( | "SELECT edition FROM Edition edition").getResultList(); It is in the facade. I tried to print result list from within facade, but it failed, so it is not about client (I guess). I added in persistence.xml and this is what came up on the console: 09:31:03,125 INFO [STDOUT] Hibernate: select edition0_.applicationId as applicat1_72_, edition0_.versionMark as versionM2_72_, edition0_.organisationId as organisa3_72_ from edition edition0_ | 09:31:03,140 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: S1009 | 09:31:03,140 ERROR [JDBCExceptionReporter] Invalid value for getLong() - '4.0.3' | I have one row in that table: applicationId=1, versionMark=4.0.3 and organisationId=1 (referenced tables contain these values - there are no constraints violated). View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921137#3921137 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921137 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: java.rmi.MarshalException thrown under RC4
What is interesting to me is that I have 7 entities in my project. All of them work fine, except that one. Here is the source for all the beans: 1. Application and Organisation have long for primary key | @Entity | @Local | @Table(name = "application") | public class Application implements Serializable{ | private long id; | | private String name; | | private Collection versions; | | public Application() { | } | | public Application(String name) { | this.name = name; | } | | @Id | @GeneratedValue(strategy = GenerationType.AUTO) | public long getId() { | return id; | } | | public void setId(long id) { | this.id = id; | } | | @Column(name="name") | public String getName() { | return name; | } | | public void setName(String name) { | this.name = name; | } | | @OneToMany | public Collection getVersions() { | return versions; | } | | public void setVersions(Collection versions) { | this.versions = versions; | } | } | | @Entity | @Local | @Table(name = "organisation") | public class Organisation implements Serializable { | long id; | | String name; | | public Organisation() { | } | | public Organisation(String name, long cityId) { | this.name = name; | } | | @Id | @GeneratedValue(strategy = GenerationType.AUTO) | public long getId() { | return id; | } | | public void setId(long id) { | this.id = id; | } | | @Column(name = "name") | public String getName() { | return name; | } | | public void setName(String name) { | this.name = name; | } | | } | 2. Version entity has a PK class with two fields: versionMark and foreign key from Application @Entity | @Local | @Table(name = "version") | public class Version implements Serializable { | | String versionMark; | | Application application; | | VersionPK versionPK; | | Collection editions; | | @EmbeddedId | @AttributeOverrides( { | @AttributeOverride(name = "versionMark", column = @Column(name = "versionMark")), | @AttributeOverride(name = "applicationId", column = @Column(name = "applicationId")) }) | public VersionPK getVersionPK() { | return versionPK; | } | | public void setVersionPK(VersionPK versionPK) { | this.versionPK = versionPK; | } | | @Column(name = "versionMark", updatable = false, insertable = false) | public String getVersionMark() { | return versionMark; | } | | public void setVersionMark(String versionMark) { | this.versionMark = versionMark; | } | | @ManyToOne | @JoinColumn(name = "applicationId", insertable = false, updatable = false) | public Application getApplication() { | return application; | } | | public void setApplication(Application application) { | this.application = application; | } | | @OneToMany(cascade = CascadeType.ALL, mappedBy = "version") | public Collection getEditions() { | return editions; | } | | public void setEditions(Collection editions) { | this.editions = editions; | } | } | and PK: | @Embeddable | public class VersionPK implements Serializable { | | private String versionMark; | | private long applicationId; | | public VersionPK() { | } | | public VersionPK(String versionMark, long applicationId) { | this.versionMark = versionMark; | this.applicationId = applicationId; | } | | public long getApplicationId() { | return applicationId; | } | | public void setApplicationId(long applicationId) { | this.applicationId = applicationId; | } | | public String getVersionMark() { | return versionMark; | } | | public void setVersionMark(String versionMark) { | this.versionMark = versionMark; | } | | public int hashCode() { | return (int) versionMark.hashCode() | + (int) (new Long(applicationId)).hashCode(); | } | | public boolean equals(Object obj) { | if (obj == this) | return true; | if (!(obj instanceof VersionPK)) | return false; | if (obj == null) | return false; | VersionPK pk = (VersionPK) obj; |
[JBoss-user] [EJB 3.0] - java.rmi.MarshalException thrown under RC4
This happens whenever ther is query executed in RC4 PFD. This is stacktrace on the client side: Exception in thread "main" java.lang.reflect.UndeclaredThrowableException | at $Proxy1.createEditionAnnotation(Unknown Source) | at com.test.TestClient.main(TestClient.java:54) | Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is: | java.io.InvalidClassException: javax.ejb.EJBException; local class incompatible: stream classdesc serialVersionUID = 2512003687642492863, local class serialVersionUID = 796770993296843510 | at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:287) | at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:131) | at org.jboss.remoting.Client.invoke(Client.java:258) | at org.jboss.remoting.Client.invoke(Client.java:221) | at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) | at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) | at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) | at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) | at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102) | ... 2 more | Caused by: java.io.InvalidClassException: javax.ejb.EJBException; local class incompatible: stream classdesc serialVersionUID = 2512003687642492863, local class serialVersionUID = 796770993296843510 | at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519) | at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546) | at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460) | at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693) | at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) | at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912) | at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836) | at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713) | at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) | at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339) | 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:260) | ... 14 more | On the server side nothing is thrown. This never happened in RC3. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921042#3921042 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921042 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - persistence.xml in EJB3.0 RC4
There are no errors reported, but my .ejb3 fails to deploy under RC4. It worked under RC3. I changed class path in JBossIDE project, so no errors are reported. This is my persistence.xml: | | java:/MySqlDS | SCMEJB.ejb3 | | | | | | | It is as if deployer finds no entity beans and as if it doesn't look at persistence.xml. EntityManager cannot be found via JNDI. There are also some SLSB in the project. They fail to deploy because of: --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- | ObjectName: persistence.units:unitName=okiManager | State: NOTYETINSTALLED | Depends On Me: | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=ApplicationFacadeBean | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=CityFacadeBean | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=EditionAnnotationFacadeBean | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=EditionFacadeBean | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=OrganisationFacadeBean | jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=VersionFacadeBean | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3920616#3920616 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3920616 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: NotSerializableException
Thanks a lot. I must have missed it somehow. But here's another: I want to add another entity (Edition) whose primary key is composed of VersionPK and primary key from another entity (Organisation - type of the key is long). Can someone tell me what would entity and PK class look like? Thanks in advance. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919289#3919289 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919289 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: NotSerializableException
Correction: Instead of: anonymous wrote : The problem is if I perform find for Version entity and try to pass it to remote client. | NotSerializableException for Version entity. The problem is: if I perform find for Version entity and try to pass it to remote client NotSerializableException is thrown for Version entity. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919229#3919229 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919229 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - NotSerializableException
Can someone tell me why this code throws NotSerializableException: package com.gint.scm.ejb.entity; | | import java.io.Serializable; | import java.util.Collection; | | import javax.ejb.Local; | import javax.persistence.Column; | import javax.persistence.Entity; | import javax.persistence.GeneratorType; | import javax.persistence.Id; | import javax.persistence.OneToMany; | import javax.persistence.Table; | | @SuppressWarnings("serial") | @Entity | @Local | @Table(name = "application") | public class Application implements Serializable{ | private long id; | | private String name; | | private Collection versions; | | public Application() { | } | | public Application(String name) { | this.name = name; | } | | @Id(generate=GeneratorType.AUTO) | public long getId() { | return id; | } | | public void setId(long id) { | this.id = id; | } | | @Column(name="name") | public String getName() { | return name; | } | | public void setName(String name) { | this.name = name; | } | | @OneToMany | public Collection getVersions() { | return versions; | } | | public void setVersions(Collection versions) { | this.versions = versions; | } | } | package com.gint.scm.ejb.entity; | | import javax.ejb.Local; | import javax.persistence.AttributeOverride; | import javax.persistence.AttributeOverrides; | import javax.persistence.Column; | import javax.persistence.EmbeddedId; | import javax.persistence.Entity; | import javax.persistence.JoinColumn; | import javax.persistence.ManyToOne; | import javax.persistence.Table; | | @SuppressWarnings("serial") | @Entity | @Local | @Table(name = "version") | public class Version { | | String versionMark; | | Application application; | | VersionPK versionPK; | | @EmbeddedId | @AttributeOverrides({ | @AttributeOverride(name="versionMark",column = @Column(name="versionMark")), | @AttributeOverride(name="applicationId",column = @Column(name="applicationId")) | }) | public VersionPK getVersionPK() { | return versionPK; | } | | public void setVersionPK(VersionPK versionPK) { | this.versionPK = versionPK; | } | | @ManyToOne | @JoinColumn(name="applicationId",insertable=false,updatable=false) | public Application getApplication() { | return application; | } | | public void setApplication(Application application){ | this.application = application; | } | } package com.gint.scm.ejb.entity; | | import java.io.Serializable; | | @SuppressWarnings("serial") | public class VersionPK implements Serializable { | | private String versionMark; | | private long applicationId; | | public VersionPK() { | } | | public VersionPK(String versionMark, long applicationId) { | this.versionMark = versionMark; | this.applicationId = applicationId; | } | | public long getApplicationId() { | return applicationId; | } | | public void setApplicationId(long applicationId) { | this.applicationId = applicationId; | } | | public String getVersionMark() { | return versionMark; | } | | public void setVersionMark(String versionMark) { | this.versionMark = versionMark; | } | | public int hashCode() { | return (int) versionMark.hashCode() | + (int) (new Long(applicationId)).hashCode(); | } | | public boolean equals(Object obj) { | if (obj == this) | return true; | if (!(obj instanceof VersionPK)) | return false; | if (obj == null) | return false; | VersionPK pk = (VersionPK) obj; | return pk.versionMark.equals(versionMark) | && pk.applicationId == applicationId; | } | | } | Creating works fine for both entities, find (by primary key) works also. The problem is if I perform find for Version entity and try to pass it to remote client. NotSerializableException for Version entity. I must say that everything works fine within container - find returns Version entity to the stateless session bean that is used as the facade. Exception is trown if Version entity is passed to the remote client from the facade. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919228#3919228 Reply to the post : http://www.jboss.com/
[JBoss-user] [EJB 3.0] - Re: Lookup of entity bean from remote client not working
Thank you for your reply, but I have one more question: How can I access this entity EJB? Are session beans the only way (since every example shows that they can be "looked up")? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917293#3917293 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917293 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Lookup of entity bean from remote client not working
I have an entity bean: | package com.test.ejb3; | | import java.io.Serializable; | | import javax.ejb.Local; | import javax.ejb.Remote; | import javax.persistence.Basic; | import javax.persistence.Column; | import javax.persistence.Entity; | import javax.persistence.Id; | import javax.persistence.Table; | | @Entity | @Table(name = "person") | @Remote(Person.class) | @Local(Person.class) | public class Person implements Serializable { | | private long id; | | private String name; | | public Person() { | }; | | public void setId(long id) { | this.id = id; | } | | @Id | public long getId() { | return id; | } | | @Basic | @Column(name = "name") | public String getName() { | return name; | } | | public void setName(String name) { | this.name = name; | } | } | The client I wrote is simple: | package com.test; | | import java.util.Enumeration; | | import javax.naming.InitialContext; | import javax.naming.NameClassPair; | import javax.naming.NamingException; | | import com.test.ejb3.Person; | | public class TestClient { | | /** | * @param args | */ | public static void main(String[] args) { | InitialContext ctx; | try { | ctx = new InitialContext(); | Person p = (Person)ctx.lookup(Person.class.getName()); | } catch (NamingException e) { | e.printStackTrace(); | } | } | | } | It throws: javax.naming.NameNotFoundException: com.test.ejb3.Person not bound Why doesn't this work? I used JMX console and used list method in JNDIView MBean. I compared the result with the result of list method in InitialContext. Initial context showed me only Global JNDI namespace, and I saw in JMX console that there is also Java namespace in which my EntityManager is. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917110#3917110 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917110 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Re: failed to implement a stand alone java client calling to
anonymous wrote : but now I lookup failed with: | | | javax.naming.NameNotFoundException: authors not bound | | at org.jnp.server.NamingServer.getBinding(NamingServer.java:514) | | at org.jnp.server.NamingServer.getBinding(NamingServer.java:522) | | at org.jnp.server.NamingServer.getObject(NamingServer.java:528) | | at org.jnp.server.NamingServer.lookup(NamingServer.java:281) | | at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source) | | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | | Did you solve it? I have the same problem, too. There are no examples on how to find (lookup) deployed EJB from VM other then EJB containers. When I look in JNDI tree in JMX console, and compare it to what InitialContext contains, I see that it does not search through java namespace, but only through global JNDI namespace. Here is the code: InitialContext ctx; | try { | ctx = new InitialContext(); | Enumeration ctxList = ctx.list(""); | int i = 0; | while (ctxList.hasMoreElements()) { | i++; | NameClassPair element = (NameClassPair) ctxList.nextElement(); | System.out.println("element "+i+" : "+element); | } | } catch (NamingException e) { | e.printStackTrace(); | } | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917094#3917094 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917094 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user