Re: [Resin-interest] PermGen problems installing Confluence

2010-03-29 Thread Daniel López
How have you increased the MaxPermGen of your resin install?
Just ot make sure you have not increased the size of the watchdog 
instead of the real instance, which happened to me at the beginning :).
Confluence has so many JSPs and other internal classes that it needs 
quite a chunk of memory for that.

The node where we are running a JIRA  Confluence instance has these 
settings inside resin.xml (Resin 3.1.5 and Confluence 2.8.1 though):

jvm-arg-server/jvm-arg
jvm-arg-XX:PermSize=128m/jvm-arg
jvm-arg-XX:MaxPermSize=192m/jvm-arg
jvm-arg-Xmx512m/jvm-arg
jvm-arg-Xms512m/jvm-arg
jvm-arg-Xss1m/jvm-arg
jvm-arg-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl/jvm-arg
jvm-arg-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl/jvm-arg

S!
D.

Rick Mann escribió:
 I'm trying to install Confluence 3.2 on my Resin-4.0.5 setup, and it seems to 
 go well until the step where it builds the database. Then it gets PermGen out 
 of memory errors. I'm installing the expanded WAR, using a JDBC datasource 
 against a MySQL database (everything else runs like this).
 
 I also tried increasing the MaxPermGen to 256 m. No luck.
 
 Any ideas? Has anyone gotten this to work?
 


-- 
---
Daniel Lopez Janariz (d.lo...@uib.es)
Web Services
Centre for Information and Technology
Balearic Islands University
(SPAIN)
---


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Hibernate transactions

2010-03-29 Thread Stargazer
On 27-Mar-2010 01:10, Stargazer wrote:
 Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
 I'd like to take it to the next level and persist something.
 Adding
   EntityTransaction tx = _manager.getTransaction();
   tx.begin();
   ...
 to the end of the CourseServlet.java file throws up

 java.lang.IllegalStateException: Container-manager @PersistenceContext
 may not use getTransaction.

 What have I missed please?



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


Could anyone tell me if this worked in an earlier vrsion of resin please?
Its the first time I've tried hibernate with resin, and I can't tell if 
its something I'm doing (or not doing!) here or related to an issue in 
4.0.5.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Hibernate transactions

2010-03-29 Thread Wesley Wu
Not a version issue.

An entitymanager should not get transaction by itself. Transaction in
a modern java appserver should be XA or JTA transaciton.
An entitymanager will detect if there is a JTA transaction existing
and will join it if there is an open one.

You need to use an injected UserTransaction instance to do the
transaction stuff and leave the entitymanager do db stuff and the
entitymanager will participate in the transaction.

-Wesley

2010/3/29 Stargazer starga...@blueyonder.co.uk

 On 27-Mar-2010 01:10, Stargazer wrote:
  Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
  I'd like to take it to the next level and persist something.
  Adding
            EntityTransaction tx = _manager.getTransaction();
            tx.begin();
            ...
  to the end of the CourseServlet.java file throws up
 
  java.lang.IllegalStateException: Container-manager @PersistenceContext
  may not use getTransaction.
 
  What have I missed please?
 
 
 
  ___
  resin-interest mailing list
  resin-interest@caucho.com
  http://maillist.caucho.com/mailman/listinfo/resin-interest
 
 
 Could anyone tell me if this worked in an earlier vrsion of resin please?
 Its the first time I've tried hibernate with resin, and I can't tell if
 its something I'm doing (or not doing!) here or related to an issue in
 4.0.5.



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Hibernate transactions

2010-03-29 Thread Scott Ferguson
Wesley Wu wrote:
 Not a version issue.

 An entitymanager should not get transaction by itself. Transaction in
 a modern java appserver should be XA or JTA transaciton.
 An entitymanager will detect if there is a JTA transaction existing
 and will join it if there is an open one.

 You need to use an injected UserTransaction instance to do the
 transaction stuff and leave the entitymanager do db stuff and the
 entitymanager will participate in the transaction.
   
Also, if you absolutely need to use the EntityTransaction, you'd need to 
grab the EntityManagerFactory, not the EntityManager. The EntityManager 
is tied into the container's transaction manager.

The UserTransaction is registered with CanDI, by the way, so it's easy 
to grab:

public class MyBean {
  @Inject UserTransaction _ut;

  ...
}

-- Scott
 -Wesley

 2010/3/29 Stargazer starga...@blueyonder.co.uk
   
 On 27-Mar-2010 01:10, Stargazer wrote:
 
 Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
 I'd like to take it to the next level and persist something.
 Adding
   EntityTransaction tx = _manager.getTransaction();
   tx.begin();
   ...
 to the end of the CourseServlet.java file throws up

 java.lang.IllegalStateException: Container-manager @PersistenceContext
 may not use getTransaction.

 What have I missed please?



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


   
 Could anyone tell me if this worked in an earlier vrsion of resin please?
 Its the first time I've tried hibernate with resin, and I can't tell if
 its something I'm doing (or not doing!) here or related to an issue in
 4.0.5.



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
 


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] PermGen problems installing Confluence

2010-03-29 Thread Rick Mann
But you just said you're running it using 192m. Did I miss something? I only 
have Confluence (so far), and a handful of other webapps.

On Mar 29, 2010, at 05:11:21, Daniel López wrote:

 I thought I had read it somewhere but I have not been able to find it in 
 the current documentation, so it could be an empiric measure, but in any 
 case I'm pretty sure 256m was not enough, at least for JIRA+confluence 
 in the same container instance.
 
 S!
 D.
 
 Rick Mann escribió:
 Thanks for the suggestion, Daniel. I did in fact try, just like that. Set it 
 to 256m.
 
 On Mar 29, 2010, at 01:00:36, Daniel López wrote:
 
 How have you increased the MaxPermGen of your resin install?
 Just ot make sure you have not increased the size of the watchdog 
 instead of the real instance, which happened to me at the beginning :).
 Confluence has so many JSPs and other internal classes that it needs 
 quite a chunk of memory for that.
 
 The node where we are running a JIRA  Confluence instance has these 
 settings inside resin.xml (Resin 3.1.5 and Confluence 2.8.1 though):
 
 jvm-arg-server/jvm-arg
 jvm-arg-XX:PermSize=128m/jvm-arg
 jvm-arg-XX:MaxPermSize=192m/jvm-arg
 jvm-arg-Xmx512m/jvm-arg
 jvm-arg-Xms512m/jvm-arg
 jvm-arg-Xss1m/jvm-arg
 jvm-arg-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl/jvm-arg
 jvm-arg-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl/jvm-arg
 
 S!
 D.
 
 Rick Mann escribió:
 I'm trying to install Confluence 3.2 on my Resin-4.0.5 setup, and it seems 
 to go well until the step where it builds the database. Then it gets 
 PermGen out of memory errors. I'm installing the expanded WAR, using a 
 JDBC datasource against a MySQL database (everything else runs like this).
 
 I also tried increasing the MaxPermGen to 256 m. No luck.
 
 Any ideas? Has anyone gotten this to work?
 
 
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Hibernate transactions

2010-03-29 Thread Stargazer

On 29-Mar-2010 17:48, Scott Ferguson wrote:

Wesley Wu wrote:
   

Not a version issue.

An entitymanager should not get transaction by itself. Transaction in
a modern java appserver should be XA or JTA transaciton.
An entitymanager will detect if there is a JTA transaction existing
and will join it if there is an open one.

You need to use an injected UserTransaction instance to do the
transaction stuff and leave the entitymanager do db stuff and the
entitymanager will participate in the transaction.

 

Also, if you absolutely need to use the EntityTransaction, you'd need to
grab the EntityManagerFactory, not the EntityManager. The EntityManager
is tied into the container's transaction manager.

The UserTransaction is registered with CanDI, by the way, so it's easy
to grab:

public class MyBean {
   @Inject UserTransaction _ut;

   ...
}

-- Scott
   
Ok thanks, I'm now sure the problem was me working from old Hibernate 
docs. But I'm still struggling.
Referring back to the example: http://wiki.caucho.com/Hibernate 
http://wiki.caucho.com/HibernateIt works perfectly as given, with 
resin 4.0.5. I added the UserTransaction and tried to make a change and 
commit but saw no difference in the db. Since the courses were listed 
I'm assuming everyting else is ok. What have I missed please? Heres the 
servlet in full:


package example;

import java.io.IOException;
import java.io.PrintWriter;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.transaction.UserTransaction;

public class CourseServlet extends HttpServlet
{
  // Resin IoC will inject this
  @PersistenceContext(unitName=example)
  private EntityManager _manager;

  @Inject
  private UserTransaction ut;

  public void service(HttpServletRequest request, HttpServletResponse 
response)

throws IOException, ServletException
  {
PrintWriter out = response.getWriter();
response.setContentType(text/html);

out.println(EntityManager =  + _manager + br/);

CourseBean []course = new CourseBean[2];

course[0] = _manager.find(CourseBean.class, new Integer(1));
course[1] = _manager.find(CourseBean.class, new Integer(2));

out.println(Course Detailsbr/br/);

for (int i = 0; i  course.length; i++) {
  out.println(course:  + course[i].getCourse() + br/);
  out.println(teacher:  + course[i].getTeacher() + br/);
}

CourseBean updateCourse = _manager.find(CourseBean.class, new 
Integer(1));

try {
ut.begin();
updateCourse.setCourse(Magic);
ut.commit();
} catch (Exception e) {
e.printStackTrace();
}
  }
}


2010/3/29 Stargazerstarga...@blueyonder.co.uk

 

On 27-Mar-2010 01:10, Stargazer wrote:

   

Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
I'd like to take it to the next level and persist something.
Adding
   EntityTransaction tx = _manager.getTransaction();
   tx.begin();
   ...
to the end of the CourseServlet.java file throws up

java.lang.IllegalStateException: Container-manager @PersistenceContext
may not use getTransaction.

What have I missed please?



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest



 

Could anyone tell me if this worked in an earlier vrsion of resin please?
Its the first time I've tried hibernate with resin, and I can't tell if
its something I'm doing (or not doing!) here or related to an issue in
4.0.5.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


 



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest