[Design of EJB 3.0] - Re: EmbeddId and TableGenerator
by phil92100
Some precisions, here is the code for the Embeddable
| @Embeddable
| public class ContactId implements Serializable {
| @GeneratedValue(strategy = GenerationType.TABLE, generator = "contact_CODE_Gen")
| @TableGenerator(name = "contact_CODE_Gen", table = "SEQUENCE_BLOCK", pkColumnName = "NAME", valueColumnName = "IDX", pkColumnValue = "contact.CODE", initialValue = 1, allocationSize = 1)
| @Column(insertable = true, updatable = true, name = "CODE")
| private java.lang.Integer code;
|
| public ContactId() {
| System.out.println("ContactId - ContactId - constructor : ");
| }
|
| public ContactId(java.lang.Integer code) {
| System.out.println("ContactId - ContactId - constructor : " + code);
| this.code = code;
| }
|
| public java.lang.Integer getCode() {
| System.out.println("ContactId - getCode - code : " + code);
| return code;
| }
|
| public void setCode(java.lang.Integer code) {
| System.out.println("ContactId - setCode - code : " + code);
| this.code = code;
| }
|
| public boolean equals(Object o) {
| return ((o instanceof ContactId) && code.equals(((ContactId) o).getCode()));
| }
|
| public int hashCode() {
| return code.hashCode();
| }
| }
|
and the entity
| @Entity(name = "ejb30/Contact")
| @EntityListeners( { ContactListener.class })
| @Table(name = "contact")
| public class Contact implements Serializable {
| static final long serialVersionUID = 1171222220859l;
|
| @EmbeddedId
| protected ContactId id;
|
| @Basic(optional = false, fetch = FetchType.EAGER)
| @Column(insertable = true, updatable = true, name = "LIBELLE")
| private java.lang.String libelle;
|
| public Contact() {
| this.id = new ContactId();
| }
|
| public Contact(java.lang.Integer code) {
| this.id = new ContactId(code);
| }
|
| public ContactId getId() {
| return id;
| }
|
| public void setId(ContactId id) {
| this.id = id;
| }
|
| public java.lang.String getLibelle() {
| return libelle;
| }
|
| public void setLibelle(java.lang.String libelle) {
| this.libelle = libelle;
| }
| }
|
And the JBoss 4.0.5 exception :
| 15:32:19,156 WARN [JDBCExceptionReporter] SQL Error: 1048, SQLState: 23000
| 15:32:19,156 ERROR [JDBCExceptionReporter] Column 'CODE' cannot be null
| 15:32:19,156 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
| org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
| at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
| at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
| at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
| at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
| at org.jboss.tm.TxManager.commit(TxManager.java:240)
| at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
| at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| 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:828)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| Caused by: java.sql.BatchUpdateException: Column 'CODE' cannot be null
| at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:828)
| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
| at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
| ... 34 more
|
Thanks for your help.
Philippe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018175#4018175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018175
19 years, 1 month
[Design of Messaging on JBoss (Messaging/JBoss)] - Messaging 1.2.0 integration with JBoss 5.0.Beta
by ovidiu.feodorov@jboss.com
I've gave it a try yesterday night. I got it working on my machine, and the integration tests pass in a significant percentage. However, there are a couple of things that need to be cleared out, either internally or with third parties. Here's a list:
1. jbossws depends on Remoting 2.2.0.Alpha2 and we need Remoting 2.2.0.Alpha7. Unless jbossws doesn't declare itself compatible with Alpha7, we can't go unscoped.
2. For some reason that's not entirely clear to me, there's a apache-logging version conflict in apache-tomcat. I don't know how to fix this. Scott?
3. For real clustering, hypersonic won't do. We need a real database. However, I probably could bend the configuration files so if started in non-clustered mode, Messaging would use hypersonic, so people can give Messaging a try in non-clustered configuration. Again, for serious stuff, people should get rid of hypersonic. If we go for MySQL, we'll need to install drivers, etc. This is related to point 5. below.
4. I badly hacked org.jboss.mq.server.jmx and I need to return to it to do it right. Scott, what do we need that package for?
5. Need two different configurations (clustered and non-clustered). Need to modify jboss's build system for that. This way, we avoid needing jgroups.jar in non-clustered mode.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018134#4018134
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018134
19 years, 1 month
[Design of JBoss Portal] - usage of third party CMS in portal
by ravindra reddy
i am using one open source CMS(MeshCMS) which is developed in java and use file based storage to store files. i integrated third party CMS to my portal by displaying it in 'iframeportlet'.
my query is i want to use the content i uploaded through third party CMS in my portal.
just like index.html on default page which is uploaded through CMS provided by JBoss, i want to display the file that i uploaded through third party CMS.
it will be more helpful incase if you mention the procedure to provide option in 'editcontent' of dashboard to select the uploaded files through third party CMS.
in 'editcontent' of dashboard we can include any portlet instance available to our page. similarly when we click the available 'cms' link we can see all the available files in CMS and we can add the required to the particular portal page. similar to 'cms' link i want to create 'externalcms' link. so that we can even choose the file to display in our portal that we uploaded through third party CMS.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018080#4018080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018080
19 years, 1 month
Quarz deployment error while starting a 5.0 head build
by Ovidiu Feodorov
This may be a know issue, but here we go
21:48:44,687 INFO [RARDeployment] Required license terms exist, view
vfsfile:/C:/work/src/svn/jboss-head/build/output/jboss-5.0.0.Beta2/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
21:48:50,296 ERROR [AbstractKernelController] Error installing to Start:
name=jboss.jca:name='quartz-ra.rar',service=RARDeployment state=Create
mode=Manual requiredState=Installed
java.lang.StackOverflowError
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:544)
at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:190)
at java.lang.StringCoding.decode(StringCoding.java:228)
at java.lang.String.<init>(String.java:405)
at java.net.URLDecoder.decode(URLDecoder.java:171)
at
org.jboss.net.protocol.file.FileURLConnection.<init>(FileURLConnection.java:66)
at
org.jboss.net.protocol.file.Handler.openConnection(Handler.java:42)
at java.net.URL.openConnection(URL.java:943)
at
org.jboss.virtual.plugins.context.AbstractURLHandler.initCacheLastModified(AbstractURLHandler.java:72)
at
org.jboss.virtual.plugins.context.AbstractURLHandler.<init>(AbstractURLHandler.java:65)
at
org.jboss.virtual.plugins.context.file.FileHandler.<init>(FileHandler.java:70)
at
org.jboss.virtual.plugins.context.file.FileHandler.<init>(FileHandler.java:89)
at
org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:253)
at
org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:186
.....
at
org.jboss.virtual.plugins.context.file.FileHandler.getChildren(FileHandler.java:171)
at
org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:239)
at
org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:186)
at
org.jboss.virtual.plugins.context.file.FileHandler.getChildren(FileHandler.java:171)
at
org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:239)
21:48:56,296 INFO [TomcatDeployment] deploy, ctxPath=/,
warUrl=vfsfile:/C:/work/src/svn/jboss-head/build/output/jboss-5.0.0.Beta2/server/default/deploy/ROOT.war/
21:48:56,828 ERROR [ProfileServiceBootstrap] Failed to load profile:
Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS IN ERROR: Name -> Error
jboss.jca:name='quartz-ra.rar',service=RARDeployment ->
java.lang.StackOverflowError
jboss.jca:name='quartz-ra.rar#quartz-ra.rar',service=RARDeployment ->
java.lang.StackOverflowError
The head was built from scratch today, Feb 16.
19 years, 1 month