Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Error on undeploy/deploy

  1. #1
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default Error on undeploy/deploy

    I'm having this strange error on try to undeploy/deploy a jar in JBoss, with this strange message:

    Illegal access: this web application instance has been stopped already. Could not load org.springframework.integration.message.ErrorMessa ge. 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.
    Note that JBoss enter a infinite loop, outputting in sucession the following trace:

    Code:
    11:04:40,318 INFO  [WebappClassLoader] Illegal access: this web application instance has been stopped already.  Could not load org.springframework.integration.message.ErrorMessage.  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:1244)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    	at org.springframework.integration.scheduling.MessagePublishingErrorHandler.handle(MessagePublishingErrorHandler.java:56)
    	at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:140)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    11:04:40,318 WARN  [MessagePublishingErrorHandler] failure occurred in messaging task
    java.lang.NullPointerException
    	at org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:908)
    	at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:395)
    	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
    	at org.springframework.integration.dispatcher.DefaultMessageDistributor.<init>(DefaultMessageDistributor.java:43)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher.getDistributor(DefaultMessageDispatcher.java:186)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher.access$1(DefaultMessageDispatcher.java:182)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher$DispatcherTask.run(DefaultMessageDispatcher.java:208)
    	at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:136)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    I'll try to investigate a little more.

    Regards.

  2. #2
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    I get rid of the infinite loop (that forced me to stop/restart JBoss that is annoying) but not of the first error. And I don't know if my change will break something else...

    In SimpleMessagingTaskScheduler I added executor.shutdown();

    Code:
    		public void run() {
    			try {
    				this.task.run();
    			}
    			catch (Throwable t) {
    				if (errorHandler != null) {
    					errorHandler.handle(t);
    				}
    				executor.shutdown();
    			}
    			if (this.shouldRepeat) {
    				MessagingTaskRunner runner = new MessagingTaskRunner(this.task);
    				runner.setShouldRepeat(true);
    				executor.execute(runner);
    			}	
    		}

  3. #3
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    This problem still happens with M2.

  4. #4
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    No one else has this problem? I'm mavenizing my project and now I'm using the m3 version of the repository that doesn't have the "hack" I made, so now I have to shutdown/restart JBoss every time I want to redeploy my war.

  5. #5
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Can you post some information about how you're deploying the components. For example, are you using ContextLoaderListener and pointing to the configuration that includes all of the Spring Integration components?

    Thanks,
    Mark

  6. #6
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    Hmmm, I think I don't understand your question, sorry. What I'm doing is just drop a war file in the server deploy dir, rewriting the old one.

    What I think it's happening is this:

    - The webapp is running a SimpleMessagingTaskScheduler::MessagingTaskRunner: :run() continuosly, from what I understand to see if there are some futures to run.

    - I drop the war on the deploy dir

    - JBoss undeploys the war

    - The webapp tries to run the MessagingTaskRunner again, it can't do it, so goes to the MessagePublishingErrorHandler::handle()

    - In here, it tries to send a ErrorMessage to the error queue

    - The error occurs when JBoss tries to WebappClassLoader::loadClass the ErrorMessage class, that is not available because the webapp was undeployed

    - it enter a loop because this error isn't catched

    Code:
    		public void run() {
    			try {
    				this.task.run();
    			}
    			catch (Throwable t) {
    				if (errorHandler != null) {
    ERROR HERE, NO CATCH -->	      errorHandler.handle(t);
    				}
    			}
    			if (this.shouldRepeat) {
    				MessagingTaskRunner runner = new MessagingTaskRunner(this.task);
    				runner.setShouldRepeat(true);
    				executor.execute(runner);
    			}	
    		}

    I hope I made myself clear...

    Just a correction, I'm now using m2 from the repository, not m3.

  7. #7
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    Like Caroline said, that first error is a NPE, not the classLoader I was telling. With my "hack" (executor.shutdown() in catch) the stack trace is this:

    Code:
    java.lang.NullPointerException
    	at org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:979)
    	at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:435)
    	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
    	at org.springframework.integration.dispatcher.DefaultMessageDistributor.<init>(DefaultMessageDistributor.java:43)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher.getDistributor(DefaultMessageDispatcher.java:186)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher.access$1(DefaultMessageDispatcher.java:182)
    	at org.springframework.integration.dispatcher.DefaultMessageDispatcher$DispatcherTask.run(DefaultMessageDispatcher.java:208)
    	at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:136)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    14:25:43,744 INFO  [WebappClassLoader] Illegal access: this web application instance has been stopped already.  Could not load org.springframework.integration.message.ErrorMessage.  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:1244)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    	at org.springframework.integration.scheduling.MessagePublishingErrorHandler.handle(MessagePublishingErrorHandler.java:59)
    	at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:141)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)

  8. #8
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Are you using log4j? If not, can you try with log4j?

    Thanks
    -Mark

  9. #9
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    I suppose so, since I'm using JBoss and it seems it iuses it by default. But I'm not a expert on this, specially not on a Friday afternoon.

    What do you want to know?

  10. #10
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    I have committed a change to avoid the loop between a MessagePublishingErrorHandler and a listener on the "errorChannel" that throws an Exception itself. It is available on the HEAD version from SVN and will be in tonight's snapshot. If you get a chance to test it please let me know.

    Also, there is a short-term workaround that you could try as described here: http://forum.springframework.org/sho...d.php?p=174364

    Thanks,
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •