GithubHelp home page GithubHelp logo

cxf-protobuf's People

Contributors

orbang avatar

Watchers

 avatar

cxf-protobuf's Issues

Threads warnings while undeploying web application.

Hi, I am using cxf-protobuf 0.3, CXF framework 2.3 and Protobuf-java 2.3 in my 
web application, which runs on Tomcat 7.

I create 2 services with these steps:

1.
    <bean class="com.package.ServicesFactoryBean"
        init-method="create" destroy-method="destroy">
        <property name="serviceName" value="ContextService" />
        <property name="protoPackage" value="ContextProtos" />
        <property name="production" value="true" />
    </bean>

    <bean class="com.package.ServicesFactoryBean"
        init-method="create" destroy-method="destroy">
        <property name="serviceName" value="JobService" />
        <property name="protoPackage" value="JobProtos" />
        <property name="production" value="true" />
    </bean>

2. Implementation of bean:

public class ServicesFactoryBean {

    ProtobufServerFactoryBean factoryBean = new ProtobufServerFactoryBean();
    String serviceName;
    String protoPackage;
    Server server;

    boolean production = true;

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public Server create() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        if (getServiceName() == null)
            throw new IllegalStateException("Service name not set in services.xml");

        String pkg;
        if (isProduction())
            pkg = "com.package.core.srv.";
        else
            pkg = "com.package.core.srv.stub.";
        Class srvBeanClass = Class.forName(pkg + getServiceName() + "Impl");
        Class msgBeanClass = Class.forName("com.package.proto." + getProtoPackage() + "$"
                + getServiceName() + "Message");
        factoryBean.setAddress("http://"
                + ClanCoreProperties.getInstance().getProperty(ClanCoreProperties.CORE_JETTY_HOST_NAME) + ":"
                + ClanCoreProperties.getInstance().getProperty(ClanCoreProperties.CORE_JETTY_PORT) + "/"
                + getServiceName());
        factoryBean.setServiceBean(srvBeanClass.newInstance());
        factoryBean.setMessageClass(msgBeanClass);

        server = factoryBean.create();
        return server;
    }

    public void destroy() {
        server.stop();
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public boolean isProduction() {
        return production;
    }

    public void setProduction(boolean production) {
        this.production = production;
    }

    public String getProtoPackage() {
        return protoPackage;
    }

    public void setProtoPackage(String protoPackage) {
        this.protoPackage = protoPackage;
    }

}

When I undeploy application from Tomcat, I get warnings about unclosed threads.

1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-23] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-24] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-25] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-26] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-27] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-28] but has failed to stop it. This is very likely to 
create a memory leak.
1.12.2010 14:05:10 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: The web application [/clan-cr-20101201] appears to have started a 
thread named [qtp12098501-29] but has failed to stop it. This is very likely to 
create a memory leak.

When I remove starting these services, there are any warnings. Could you help 
me to fix these problems? Thanks a lot.

Original issue reported on code.google.com by [email protected] on 1 Dec 2010 at 1:21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.