You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ali Mahdoui <ma...@hotmail.de> on 2010/06/10 23:23:44 UTC
Cocoon 2.2 + openjpa
Hi,is there any tutorial or example how to use openjpa with cocoon 2.2?Thanks!Ali
_________________________________________________________________
http://redirect.gimas.net/?n=M1006xHMTL5
Tschüss Werbung im E-Mail-Abbinder!
RE: Cocoon 2.2 + openjpa
Posted by Robby Pelssers <ro...@ciber.com>.
Hi Ali,
Suppose you have a cocoon application with multiple cocoon blocks A, B and C.
The default rcl.properties will contain something like
com.mycompany.blockA.service%classes-dir=./target/classes
This will ensure that whenever you are running the application (while still developing) you can make changes in your java classes and pressing F5 in the browser will immediately reflect those changes.
You could also have a situation where block B depends on block A
com.mycompany.blockB.service%classes-dir=./target/classes
com.mycompany.blockA.service%classes-dir=../blockA/target/classes --> use the classes from the target folder of block A
%exclude-lib=com.mycompany:blockA --> exclude the jar from block A
I’m no expert on classloaders but I think you should comment out these lines when moving to a production environment.
And just like you noticed this can even cause classloading issues while still developing so also in that cause you can comment out these lines.
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Friday, June 11, 2010 10:28 PM
To: Cocoon users
Subject: RE: Cocoon 2.2 + openjpa
disabled everything from the rcl.properties, clean and run and now everything works perfectly.
Thanks Robby!!!!!!!
could you please explain what was the problem? how does rcl.properties causes the problem?
Thanks again!
Ali
________________________________
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 10:41:24 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
You might want to disable everything from the rcl.properties file. I had similar issues in the past and that helped fixing the classloader issue.
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Friday, June 11, 2010 10:22 AM
To: Cocoon users
Subject: RE: Cocoon 2.2 + openjpa
I have all that configured. The problem when i call fom some class this code
BeanClass bean = manager.find(BeanClass.class, id);
i get always the exception that BeanClass can not be cast to BeanClass....
After some debug jobs if found that the ClassLoader of the entitiyManagerFactory is another as the one of my calling class
and because of that i become the exception.
I am wondering if there is some spring configuration properties which schold be set, such that the entityManager uses another classLoader (for example the one of the calling block...)
Thanks for any help
Ali
________________________________
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 09:24:12 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
I’d say… who cares if you’re using Cocoon2.2?
Just start using openJPA as you would for any other java project…
-Add the needed dependencies to your pom.
-Start configuring some beans in your block-application-context.xml
-write your pojo’s and annotate them
-from flowscript do the work you need to do by
var mybean = cocoon.getComponent(“mybean”);
mybean.doSomething();
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Thursday, June 10, 2010 11:24 PM
To: Cocoon users
Subject: Cocoon 2.2 + openjpa
Hi,
is there any tutorial or example how to use openjpa with cocoon 2.2?
Thanks!
Ali
________________________________
Tschüss Werbung im E-Mail-Abbinder! <http://redirect.gimas.net/?n=M1006HMTL2>
________________________________
Künftig E-Mails ohne Werbung – Nutzen Sie Hotmail auch geschäftlich. <http://redirect.gimas.net/?n=M1006HMTL3>
________________________________
Künftig E-Mails über Hotmail ohne Werbung versenden! <http://redirect.gimas.net/?n=M1006HMTL1>
RE: Cocoon 2.2 + openjpa
Posted by Ali Mahdoui <ma...@hotmail.de>.
disabled everything from the rcl.properties, clean and run and now everything works perfectly.Thanks Robby!!!!!!!could you please explain what was the problem? how does rcl.properties causes the problem?Thanks again!Ali
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 10:41:24 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
You might want to disable everything from the rcl.properties file. I had similar issues in the past and that
helped fixing the classloader issue.
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Friday, June 11, 2010 10:22
AM
To: Cocoon users
Subject: RE: Cocoon 2.2 + openjpa
I have all that configured. The problem when i call fom some class this code
BeanClass bean = manager.find(BeanClass.class, id);
i get always the exception that BeanClass can not be cast to BeanClass....
After some debug jobs if found that the ClassLoader of the entitiyManagerFactory
is another as the one of my calling class
and because of that i become the exception.
I am wondering if there is some spring configuration properties which schold be
set, such that the entityManager uses another classLoader (for example the one
of the calling block...)
Thanks for any help
Ali
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 09:24:12 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
I’d
say… who cares if you’re using Cocoon2.2?
Just
start using openJPA as you would for any other
java project…
-Add
the needed dependencies to your pom.
-Start
configuring some beans in your block-application-context.xml
-write
your pojo’s and annotate them
-from
flowscript do the work you need to do by
var mybean = cocoon.getComponent(“mybean”);
mybean.doSomething();
Robby
From:
Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Thursday, June 10, 2010
11:24 PM
To: Cocoon users
Subject: Cocoon 2.2 + openjpa
Hi,
is there any tutorial or example how to use
openjpa with cocoon 2.2?
Thanks!
Ali
Tschüss Werbung im E-Mail-Abbinder!
Künftig
E-Mails ohne Werbung – Nutzen Sie Hotmail auch geschäftlich.
_________________________________________________________________
http://redirect.gimas.net/?n=M1006xHMTL4
Künftig E-Mails über Hotmail ohne Werbung versenden!
RE: Cocoon 2.2 + openjpa
Posted by Robby Pelssers <ro...@ciber.com>.
You might want to disable everything from the rcl.properties file. I had similar issues in the past and that helped fixing the classloader issue.
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Friday, June 11, 2010 10:22 AM
To: Cocoon users
Subject: RE: Cocoon 2.2 + openjpa
I have all that configured. The problem when i call fom some class this code
BeanClass bean = manager.find(BeanClass.class, id);
i get always the exception that BeanClass can not be cast to BeanClass....
After some debug jobs if found that the ClassLoader of the entitiyManagerFactory is another as the one of my calling class
and because of that i become the exception.
I am wondering if there is some spring configuration properties which schold be set, such that the entityManager uses another classLoader (for example the one of the calling block...)
Thanks for any help
Ali
________________________________
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 09:24:12 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
I’d say… who cares if you’re using Cocoon2.2?
Just start using openJPA as you would for any other java project…
-Add the needed dependencies to your pom.
-Start configuring some beans in your block-application-context.xml
-write your pojo’s and annotate them
-from flowscript do the work you need to do by
var mybean = cocoon.getComponent(“mybean”);
mybean.doSomething();
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Thursday, June 10, 2010 11:24 PM
To: Cocoon users
Subject: Cocoon 2.2 + openjpa
Hi,
is there any tutorial or example how to use openjpa with cocoon 2.2?
Thanks!
Ali
________________________________
Tschüss Werbung im E-Mail-Abbinder! <http://redirect.gimas.net/?n=M1006HMTL2>
________________________________
Künftig E-Mails ohne Werbung – Nutzen Sie Hotmail auch geschäftlich. <http://redirect.gimas.net/?n=M1006HMTL3>
RE: Cocoon 2.2 + openjpa
Posted by Ali Mahdoui <ma...@hotmail.de>.
I have all that configured. The problem when i call fom some class this code
BeanClass bean = manager.find(BeanClass.class, id);
i get always the exception that BeanClass can not be cast to BeanClass....
After some debug jobs if found that the ClassLoader of the entitiyManagerFactory is another as the one of my calling class
and because of that i become the exception.
I am wondering if there is some spring configuration properties which schold be set, such that the entityManager uses another classLoader (for example the one of the calling block...)
Thanks for any help
Ali
Subject: RE: Cocoon 2.2 + openjpa
Date: Fri, 11 Jun 2010 09:24:12 +0200
From: robby.pelssers@ciber.com
To: users@cocoon.apache.org
I’d say… who cares if you’re using Cocoon2.2?
Just start using openJPA
as you would for any other java project…
-Add the needed dependencies to your pom.
-Start configuring some beans in your
block-application-context.xml
-write your pojo’s
and annotate them
-from flowscript do
the work you need to do by
var mybean = cocoon.getComponent(“mybean”);
mybean.doSomething();
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Thursday, June 10, 2010
11:24 PM
To: Cocoon users
Subject: Cocoon 2.2 + openjpa
Hi,
is
there any tutorial or example how to use openjpa with cocoon 2.2?
Thanks!
Ali
Tschüss
Werbung im
E-Mail-Abbinder!
_________________________________________________________________
http://redirect.gimas.net/?n=M1006xHMTL6
Künftig E-Mails ohne Werbung – Nutzen Sie Hotmail auch geschäftlich.
RE: Cocoon 2.2 + openjpa
Posted by Robby Pelssers <ro...@ciber.com>.
I’d say… who cares if you’re using Cocoon2.2?
Just start using openJPA as you would for any other java project…
-Add the needed dependencies to your pom.
-Start configuring some beans in your block-application-context.xml
-write your pojo’s and annotate them
-from flowscript do the work you need to do by
var mybean = cocoon.getComponent(“mybean”);
mybean.doSomething();
Robby
From: Ali Mahdoui [mailto:mahdoui@hotmail.de]
Sent: Thursday, June 10, 2010 11:24 PM
To: Cocoon users
Subject: Cocoon 2.2 + openjpa
Hi,
is there any tutorial or example how to use openjpa with cocoon 2.2?
Thanks!
Ali
________________________________
Tschüss Werbung im E-Mail-Abbinder! <http://redirect.gimas.net/?n=M1006HMTL2>