繁体   English   中英

非法访问:此 Web 应用程序实例已被停止

[英]Illegal access: this web application instance has been stopped already

我有一个类,它在 xml 中定义了一个 init 方法

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用程序启动时,这些线程运行良好,一切正常,一段时间后我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在 doStuff 方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,任何想法?

我有一个在xml中定义了初始化方法的类

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用启动时,这些线程运行良好,并且一切正常,一段时间后,我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在doStuff方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,有什么主意吗?

我有一个在xml中定义了初始化方法的类

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用启动时,这些线程运行良好,并且一切正常,一段时间后,我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在doStuff方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,有什么主意吗?

我有一个在xml中定义了初始化方法的类

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用启动时,这些线程运行良好,并且一切正常,一段时间后,我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在doStuff方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,有什么主意吗?

我有一个在xml中定义了初始化方法的类

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用启动时,这些线程运行良好,并且一切正常,一段时间后,我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在doStuff方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,有什么主意吗?

我有一个在xml中定义了初始化方法的类

<bean id="appStarter" class="com.myapp.myClass" init-method="init" destroy-method="destroy"/>

我的课:

public class myClass{

    private Thread t;

    public void init() {

             t = new Thread() {

                @Override
                public void run() {
                    while (true)
                        try {
                            doStuff();
                            Thread.sleep(1000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                }

            };
            t.start();
        }

public void destroy() {
        t.interrupt();
    }

}

当应用启动时,这些线程运行良好,并且一切正常,一段时间后,我收到以下异常。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.mail.imap.IMAPStore.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.mail.Session.getService(Session.java:755)
    at javax.mail.Session.getStore(Session.java:569)
    at javax.mail.Session.getStore(Session.java:531)
    at javax.mail.Session.getStore(Session.java:510)

在doStuff方法中:

public void doStuff(){

Session sessioned = Session.getDefaultInstance(System.getProperties(),
                null);
        Store store = sessioned.getStore("imap");
        store.connect(hostName, userName, password);
.
.
.

}

我不知道为什么,有什么主意吗?

我在停止apache tomcat时遇到了这个问题,我通过删除apache上的所有项目来编辑它。

我有这个确切的错误。 我的应用程序在 eclipse 开发环境中运行良好,但是当部署到生产 Tomcat 服务器时,应用程序将正常加载,然后当调用端点时,它生成了错误:

[放弃的连接清理线程] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading 非法访问:此Web 应用程序实例已停止。 不能加载 []

错误是因为有两个不同的java版本引起的。 我在 eclipse 中的开发环境设置为 jdk-15,生产服务器运行版本 11。

为了解决这个问题,在 eclipse 中,即使使用 jdk-15,我也模拟了 java-11:

eclipse > 属性 > java 编译器

在此处输入图片说明

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM