christianPa / full-hibernate-plugin-for-struts2

Automatically exported from code.google.com/p/full-hibernate-plugin-for-struts2
0 stars 0 forks source link

Stack Overflow when calling classes that spawn threads #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

include a class like this in an action:

public class GCImpl implements GC
{
    Logger logger = Logger.getLogger(this.getClass());
    private Handler handler;

    private GCImpl()
    {
        handler = new Handler();
        new Thread(handler, "Handler").start();
    }   
    private class Handler extends Thread
    {
        @Override
        public void run()
        {
            while (true)
            {
                synchronized (this)
                {
                    //do stuff;
                    try
                    {
                        wait(1000);
                    }
                    catch (Exception e)
                    {
                        logger.error("Exception thrown " + e.getMessage(), e);
                    }
                }
            }
        }
    }
}

What is the expected output? What do you see instead?
java.lang.StackOverflowError
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findResource(URLClassLoader.java:382)
    java.lang.ClassLoader.getResource(ClassLoader.java:1003)
    java.lang.ClassLoader.getResource(ClassLoader.java:998)
    java.lang.ClassLoader.getSystemResource(ClassLoader.java:1101)
    java.lang.Class.getResource(Class.java:2072)
    com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.isCandidadeClass(SessionTransactionInjectorInterceptor.java:396)
    com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.injectHibernateCoreSessionByAnnotation(SessionTransactionInjectorInterceptor.java:459)

........

What version of the product are you using? On what operating system?
2.2-GA

Please provide any additional information below.
I am using Spring's DI to inject this class into my action, but it doesn't 
require a hibernate session to run so @SessionTarget is not set.

Original issue reported on code.google.com by ben%ultr...@gtempaccount.com on 3 Sep 2010 at 9:24

GoogleCodeExporter commented 8 years ago
Hello. My friend, this plugin is for using without spring. If you're using 
spring for Hibernate Session injection, no need of use this project. 
Compatibility between theese project is not guaranteed.

Original comment by jyoshiriro on 8 Sep 2010 at 9:56