---
title: "java.lang.IllegalStateExceptThis loader has been closed and should not be in use"
author: "rommal7090"
date: "2010-03-26T22:33:27Z"
tags: ["Cache", "Java", "Weblogic", "Websphere"]
categories: ["企业架构"]
slug: "java-lang-illegalstateexceptthis-loader-has-been-closed-and-should-not-be-in-use"
draft: false
lastmod: "2010-03-26T22:33:27Z"
id: 625830
url: "https://rommal7090.iteye.com/blog/625830"
---

今天用OC4J重新deploy一个project以后出现了

### Caused by: java.lang.IllegalStateException: ClassLoader xxxx: This loader has been closed and should not be in use.

网上找了下发现是由于我们使用了一个VM Cache,当我们undeploy project后，Cache的instance还在运行，当project重新deploy以后，它会访问这个cache instance,但是这个cache instance里面cache的java class 之类的早已不存在，故会报 "This loader has been closed and should not be in use".

 

这时候将你的容器（oc4j，weblogic,websphere...）重新启动就好了