Re: Tomee debug mode exceptions

2012-06-12 Thread Romain Manni-Bucau
Hi,

We use by default JUL and logging.properties.

- Romain
Le 13 juin 2012 05:15, "zeeman"  a écrit :

> I have enabled OpenEJB debug logging (I have a log4j.properties under
> main/resources). But don't see any debug output. How is logging configured
> in Tomee?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-debug-mode-exceptions-tp4655537p4655575.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: Tomee Hibernate Session JNDI

2012-06-12 Thread Romain Manni-Bucau
I didnt test but i guess you ll need to do a custom Reference to unwrap the
session from the emf and you can bind it in tomcat in comp/env for
instance. Another is to do an openejb/tomee resource, declare it in
tomee.xml or resources.xml and use openejb/Resource/nameused as jndi name.

- Romain
Le 13 juin 2012 05:23, "zeeman"  a écrit :

> Hi,
>
> I'm using Hibernate Search 4.1 with Lucene. I want to use this feature that
> controls indexing from JMX IndexControlMBean
>
> http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#d0e6897
>
> It requires hibernate.session_factory_name to be bound in JNDI. What value
> should I use in peristence.xml? Keep in mind I use JPA.
>
> Here is my persistence.xml that works well in Tomee 1.0 and Hibernate 4.1:
>
> 
>org.hibernate.ejb.HibernatePersistence
>myDS
>false
>ENABLE_SELECTIVE
>
> value="org.hibernate.dialect.PostgreSQLDialect" />
> value="validate" />
> value="0" />
>
> value="true" />
>
> value="false" />
> name="hibernate.cache.use_second_level_cache" value="false"/>
> name="hibernate.cache.infinispan.statistics" value="true"/>
>
> name="hibernate.cache.region.factory_class"
> value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>
> value="true"/>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Hibernate-Session-JNDI-tp4655576.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Tomee Hibernate Session JNDI

2012-06-12 Thread zeeman
Hi,

I'm using Hibernate Search 4.1 with Lucene. I want to use this feature that
controls indexing from JMX IndexControlMBean
http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#d0e6897

It requires hibernate.session_factory_name to be bound in JNDI. What value
should I use in peristence.xml? Keep in mind I use JPA.

Here is my persistence.xml that works well in Tomee 1.0 and Hibernate 4.1:


org.hibernate.ejb.HibernatePersistence
myDS
false
ENABLE_SELECTIVE

   
 














--
View this message in context: 
http://openejb.979440.n4.nabble.com/Tomee-Hibernate-Session-JNDI-tp4655576.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Tomee debug mode exceptions

2012-06-12 Thread zeeman
I have enabled OpenEJB debug logging (I have a log4j.properties under
main/resources). But don't see any debug output. How is logging configured
in Tomee?

--
View this message in context: 
http://openejb.979440.n4.nabble.com/Tomee-debug-mode-exceptions-tp4655537p4655575.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Feedback on TomEE 1.0.0

2012-06-12 Thread zeeman
This a great idea Anthony, I think it should be right on Tomee docs. Can you
update this thread when you have it done? Thanks. 

Eclipse is still behaving with Tomee, whenever I make changes (XHTML or
Java) Tomee is restarted, even when I have auto reloading disabled. I have
installed M2e WTP, jars get copied correctly to web-inf/lib but debugging
experience sucks big time. 

--
View this message in context: 
http://openejb.979440.n4.nabble.com/Feedback-on-TomEE-1-0-0-tp4655483p4655574.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: JSF2 project migrated from Jboss AS7 to Tomee not working

2012-06-12 Thread Romain Manni-Bucau
Push the issue, maybe on myfaces mailing list. But if there are issue well
fix them
Le 13 juin 2012 01:22, "zeeman"  a écrit :

> Update, it turns out that Myfaces does not process navigation rules the
> same
> as Mojarra. After changing my navigation rules things started working
> again.
> However, there are still some subtle unresolved issues with the UI. But the
> response time and the app seems to be working more reliably on Tomee stack.
> At least in Tomee there is no PermGen errors like AS7 after redeploying 4
> times.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JSF2-project-migrated-from-Jboss-AS7-to-Tomee-not-working-tp4655453p4655570.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread Romain Manni-Bucau
Hi, does contact has relationships too? If yes same issue.
Le 12 juin 2012 22:18, "georgenis"  a écrit :

> Hi romain,
>
> i debugged my application, when i call the method "getContactList().size()"
> i get no lazyloading exception. I think its not the "right" way to
> develope.
> Is there any possibility to develope it in the right way?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655569.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: Feedback on TomEE 1.0.0

2012-06-12 Thread Anthony Fryer
I'll do a blog about setting up using eclipse, maven and tomee.  Do you have
a tomee blog site that i can use?

--
View this message in context: 
http://openejb.979440.n4.nabble.com/Feedback-on-TomEE-1-0-0-tp4655483p4655571.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: JSF2 project migrated from Jboss AS7 to Tomee not working

2012-06-12 Thread zeeman
Update, it turns out that Myfaces does not process navigation rules the same
as Mojarra. After changing my navigation rules things started working again.
However, there are still some subtle unresolved issues with the UI. But the
response time and the app seems to be working more reliably on Tomee stack.
At least in Tomee there is no PermGen errors like AS7 after redeploying 4
times.

--
View this message in context: 
http://openejb.979440.n4.nabble.com/JSF2-project-migrated-from-Jboss-AS7-to-Tomee-not-working-tp4655453p4655570.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread georgenis
Hi romain,

i debugged my application, when i call the method "getContactList().size()"
i get no lazyloading exception. I think its not the "right" way to develope.
Is there any possibility to develope it in the right way?



--
View this message in context: 
http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655569.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread Romain Manni-Bucau
Can you debug the returned list please?
Le 12 juin 2012 17:35, "georgenis"  a écrit :

> Yes, I am using an EJB.
>
> I pasted my full class on following link:
>
> http://pastebin.com/vVcZx4aB
>
> I am not allowed to share it completely :-( Its a company training project
> not for external people. I hope you can help me as much as possible.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655566.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread georgenis
Yes, I am using an EJB.

I pasted my full class on following link: 

http://pastebin.com/vVcZx4aB

I am not allowed to share it completely :-( Its a company training project
not for external people. I hope you can help me as much as possible.

--
View this message in context: 
http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655566.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread Romain Manni-Bucau
Are you in an ejb? Well share a project reproducing it maybe, look our
rest-on-ejb sample too.
Le 12 juin 2012 17:20, "georgenis"  a écrit :

> Which getter?
>
> I have a similiar method just for customers and contacts. I tried it like
> this:
>
>public Customer getCustomer(
>String customerId, String sessionId) throws
> Exception{
>Session session = sessionBean.isSessionValid(sessionId);
>if(session!=null) {
>Customer customer = (Customer)
> entityManager.find(Customer.class,
> customerId);
>if(customer==null) {
>throw new Exception("Customer does not
> exists >>> "+customerId);
>}
>customer.getContactList();
>return customer;
>}
>return null;
>}
>
> Before I return my Entity i call the getter-Method which should load all
> Contacts in my Customer Object. But my session is still closed?! I think i
> didnt understand you.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655563.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread georgenis
Which getter?

I have a similiar method just for customers and contacts. I tried it like
this:

public Customer getCustomer(
String customerId, String sessionId) throws Exception{
Session session = sessionBean.isSessionValid(sessionId);
if(session!=null) {
Customer customer = (Customer) 
entityManager.find(Customer.class,
customerId);
if(customer==null) {
throw new Exception("Customer does not exists 
>>> "+customerId);
}
customer.getContactList();
return customer;
}
return null;
}

Before I return my Entity i call the getter-Method which should load all
Contacts in my Customer Object. But my session is still closed?! I think i
didnt understand you.

--
View this message in context: 
http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655563.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread Romain Manni-Bucau
Just call your getter before returning your entity.
Le 12 juin 2012 16:31, "georgenis"  a écrit :

> Sorry Romain,
>
> i am a beginner and do not really understand what you tried to say to me?!
> I
> have to implement an method which fetch all "roles"?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655561.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread georgenis
Sorry Romain,

i am a beginner and do not really understand what you tried to say to me?! I
have to implement an method which fetch all "roles"?



--
View this message in context: 
http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655561.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread Romain Manni-Bucau
Hi,

You need to init the relationships before going out of a transaction scope.
You can either use a fetch query or simply call getMyRelationShip() because
returning the entity.

- Romain
Le 12 juin 2012 13:50, "georgenis"  a écrit :

> hi guys,
>
> i have still a problem with this lazy loading issue. I changed in my
> persistence.xml "transaction-type" to "JTA" to manage all transactions with
> the container.
>
> But the LazyLoading ISSUE is still alive :(
>
>
> Can anyone help me?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p469.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: CMP failed with 3 layered Object structure

2012-06-12 Thread georgenis
hi guys,

i have still a problem with this lazy loading issue. I changed in my
persistence.xml "transaction-type" to "JTA" to manage all transactions with
the container.

But the LazyLoading ISSUE is still alive :(


Can anyone help me?

--
View this message in context: 
http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p469.html
Sent from the OpenEJB User mailing list archive at Nabble.com.