You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fortress@directory.apache.org by Shawn McKinney <sm...@apache.org> on 2015/04/21 15:37:36 UTC

Re: [Bulk] problem deploying fortress-rest

> On Apr 21, 2015, at 5:25 AM, Oleksandr Bodriagov (Polystar) <ol...@polystar.com> wrote:
> 
> For some reason I cannot deploy target/fortress-rest.war in Tomcat 8.0.21.
> I tried doing it manually by copying target/fortress-rest.war to webapps
> in Tomcat because "mvn tomcat:deploy² returns
> 
> [ERROR] Failed to execute goal
> org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project
> fortress-rest: Cannot invoke Tomcat manager: Error writing to server ->
> [Help 1]
> 
> If I do it manually I get the following error in catalina logs:
> 
> 21-Apr-2015 12:15:48.625 INFO [localhost-startStop-2]
> org.apache.catalina.startup.HostConfig.deployWAR Deploying web application
> archive /usr/local/apache-tomcat-8.0.21/webapps/fortress-rest.war
> 21-Apr-2015 12:15:48.629 WARNING [localhost-startStop-2]
> org.apache.tomcat.util.digester.SetPropertiesRule.begin
> [SetPropertiesRule]{Context/Realm} Setting property 'debug' to '0' did not
> find a matching property.
> 21-Apr-2015 12:15:48.630 WARNING [localhost-startStop-2]
> org.apache.tomcat.util.digester.SetPropertiesRule.begin
> [SetPropertiesRule]{Context/Realm} Setting property 'resourceName' to
> 'UserDatabase' did not find a matching property.
> 

From the error it looks like there are properties mapped from context.xml that conflict with the runtime.  Specifically resourceName and debug.  Since fortress doesn’t use either, I have removed them from the context.xml for fortress-rest and tested for Tomcat 8.0.18.  If that doesn’t work let me know and I’ll try running on 8.0.21.

Thanks 

Shawn
smckinney@apache.org

Re: Re: [Bulk] [Bulk] problem deploying fortress-rest

Posted by Shawn McKinney <sm...@apache.org>.
> On Apr 21, 2015, at 9:04 AM, Oleksandr Bodriagov (Polystar) <ol...@polystar.com> wrote:
> 
> It gets deployed now, but it fails to start now:
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 14.597s
> [INFO] Finished at: Tue Apr 21 15:49:57 CEST 2015
> [INFO] Final Memory: 30M/548M
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project
> fortress-rest: Cannot invoke Tomcat manager: FAIL - Deployed application
> at context path /fortress-rest-1.0-RC40-SNAPSHOT but context failed to
> start -> [Help 1]
> 

Hmmm, I’m stumped.  I did notice some noise in those logs, including:

21-Apr-2015 16:01:28.951 INFO [Statistics Thread-fortress-rest-1]
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoadi
ng Illegal access: this web application instance has been stopped already.
Could not load [java.lang.OutOfMemoryError]. The following stack trace is
thrown for debugging purposes as well as to attempt to terminate the
thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application
instance has been stopped already. Could not load
[java.lang.OutOfMemoryError]. The following stack trace is thrown for
debugging purposes as well as to attempt to terminate the thread which
caused the illegal access.

Just to make sure we have everything running clean, can you shutdown tomcat, manually remove the fortress-rest deployment, restart and redeploy:

mvn clean tomcat:deploy

I doubt this will resolve your error, but worth a try.  Also what version of java are you using?

Thanks,

Shawn
smckinney@apache.org

Re: [Bulk] problem deploying fortress-rest

Posted by "Oleksandr Bodriagov (Polystar)" <ol...@polystar.com>.
It gets deployed now, but it fails to start now:
[INFO] BUILD FAILURE
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 14.597s
[INFO] Finished at: Tue Apr 21 15:49:57 CEST 2015
[INFO] Final Memory: 30M/548M
[INFO] 
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project
fortress-rest: Cannot invoke Tomcat manager: FAIL - Deployed application
at context path /fortress-rest-1.0-RC40-SNAPSHOT but context failed to
start -> [Help 1]


From catalina logs when I run "mvn tomcat:redeploy":


21-Apr-2015 15:59:43.202 INFO [http-nio-8080-exec-1]
org.apache.catalina.startup.HostConfig.undeploy Undeploying context
[/fortress-rest-1.0-RC40-SNAPSHOT]
21-Apr-2015 15:59:43.230 INFO [http-nio-8080-exec-1]
org.apache.catalina.startup.HostConfig.deployWAR Deploying web application
archive 
/usr/local/apache-tomcat-8.0.21/webapps/fortress-rest-1.0-RC40-SNAPSHOT.war
21-Apr-2015 15:59:43.234 INFO [http-nio-8080-exec-1] null.null
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.setDefaultRole
s <>
21-Apr-2015 15:59:43.234 INFO [http-nio-8080-exec-1] null.null
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.setContainerTy
pe <TomcatContext>
21-Apr-2015 15:59:43.234 INFO [http-nio-8080-exec-1] null.null
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.setRealmClassp
ath <>
21-Apr-2015 15:59:43.786 INFO [http-nio-8080-exec-1]
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.initialize
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.initialize
Tomcat7 Context-based policy agent
21-Apr-2015 15:59:43.786 INFO [http-nio-8080-exec-1] null.null
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.initialize -
instantiate policy agent name:
org.apache.directory.fortress.realm.tomcat.TcAccessMgrImpl
21-Apr-2015 15:59:44.535 INFO [http-nio-8080-exec-1]
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.initialize
org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy J2EE Tomcat7
policy agent initialization successful
21-Apr-2015 15:59:46.595 WARNING [http-nio-8080-exec-1]
org.apache.catalina.startup.ContextConfig.validateSecurityRoles Security
role name fortress-rest-user used in an <auth-constraint> without being
defined in a <security-role>
21-Apr-2015 15:59:47.583 SEVERE [http-nio-8080-exec-1]
org.apache.catalina.core.StandardContext.startInternal Error listenerStart
21-Apr-2015 15:59:47.583 SEVERE [http-nio-8080-exec-1]
org.apache.catalina.core.StandardContext.startInternal Context
[/fortress-rest-1.0-RC40-SNAPSHOT] startup failed due to previous errors
21-Apr-2015 15:59:47.589 WARNING [http-nio-8080-exec-1]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads
The web application [fortress-rest-1.0-RC40-SNAPSHOT] appears to have
started a thread named [pool-13-thread-1] but has failed to stop it. This
is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Synchrono
usQueue.java:460)
 java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQu
eue.java:362)
 java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:10
66)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
:617)
 java.lang.Thread.run(Thread.java:745)
21-Apr-2015 15:59:47.590 WARNING [http-nio-8080-exec-1]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads
The web application [fortress-rest-1.0-RC40-SNAPSHOT] appears to have
started a thread named [NioProcessor-1] but has failed to stop it. This is
very likely to create a memory leak. Stack trace of thread:
 sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
 sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
 sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:103)
 sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
 sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
 org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java
:72)
 org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(Abst
ractPollingIoProcessor.java:1077)
 org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.jav
a:64)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1142)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
:617)
 java.lang.Thread.run(Thread.java:745)
21-Apr-2015 15:59:47.590 WARNING [http-nio-8080-exec-1]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads
The web application [fortress-rest-1.0-RC40-SNAPSHOT] appears to have
started a thread named [fortress-rest] but has failed to stop it. This is
very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.util.TimerThread.mainLoop(Timer.java:552)
 java.util.TimerThread.run(Timer.java:505)
21-Apr-2015 15:59:47.591 WARNING [http-nio-8080-exec-1]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads
The web application [fortress-rest-1.0-RC40-SNAPSHOT] appears to have
started a thread named [Statistics Thread-fortress-rest-1] but has failed
to stop it. This is very likely to create a memory leak. Stack trace of
thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
tNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Sch
eduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Sch
eduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:10
67)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
:617)
 java.lang.Thread.run(Thread.java:745)
21-Apr-2015 15:59:47.592 INFO [http-nio-8080-exec-1]
org.apache.catalina.startup.HostConfig.deployWAR Deployment of web
application archive
/usr/local/apache-tomcat-8.0.21/webapps/fortress-rest-1.0-RC40-SNAPSHOT.war
 has finished in 4,362 ms
21-Apr-2015 16:00:20.962 INFO [NioProcessor-1]
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoadi
ng Illegal access: this web application instance has been stopped already.
Could not load [org.apache.mina.transport.socket.nio.NioProcessor$1]. The
following stack trace is thrown for debugging purposes as well as to
attempt to terminate the thread which caused the illegal access.
 java.lang.IllegalStateException: Illegal access: this web application
instance has been stopped already. Could not load
[org.apache.mina.transport.socket.nio.NioProcessor$1]. The following stack
trace is thrown for debugging purposes as well as to attempt to terminate
the thread which caused the illegal access.
	at 
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoadi
ng(WebappClassLoaderBase.java:1327)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(
WebappClassLoaderBase.java:1313)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoade
rBase.java:1196)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoade
rBase.java:1157)
	at 
org.apache.mina.transport.socket.nio.NioProcessor$IoSessionIterator.<init>(
NioProcessor.java:311)
	at 
org.apache.mina.transport.socket.nio.NioProcessor.allSessions(NioProcessor.
java:93)
	at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.notifyIdleSessions(
AbstractPollingIoProcessor.java:760)
	at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$900(Abstract
PollingIoProcessor.java:67)
	at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(Abstr
actPollingIoProcessor.java:1135)
	at 
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java
:64)
	at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1
142)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
617)
	at java.lang.Thread.run(Thread.java:745)

21-Apr-2015 16:01:28.951 INFO [Statistics Thread-fortress-rest-1]
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoadi
ng Illegal access: this web application instance has been stopped already.
Could not load [java.lang.OutOfMemoryError]. The following stack trace is
thrown for debugging purposes as well as to attempt to terminate the
thread which caused the illegal access.
 java.lang.IllegalStateException: Illegal access: this web application
instance has been stopped already. Could not load
[java.lang.OutOfMemoryError]. The following stack trace is thrown for
debugging purposes as well as to attempt to terminate the thread which
caused the illegal access.
	at 
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoadi
ng(WebappClassLoaderBase.java:1327)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(
WebappClassLoaderBase.java:1313)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoade
rBase.java:1196)
	at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoade
rBase.java:1157)
	at 
net.sf.ehcache.util.concurrent.ConcurrentHashMap.values(ConcurrentHashMap.j
ava:2717)
	at 
net.sf.ehcache.util.concurrent.ConcurrentHashMap.values(ConcurrentHashMap.j
ava:221)
	at 
net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl$1.run(ExtendedSta
tisticsImpl.java:105)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access
$301(ScheduledThreadPoolExecutor.java:180)
	at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Sc
heduledThreadPoolExecutor.java:294)
	at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1
142)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
617)
	at java.lang.Thread.run(Thread.java:745)



/Oleksandr


On 21/4/2015 15:37 , "Shawn McKinney" <sm...@apache.org> wrote:

>
>> On Apr 21, 2015, at 5:25 AM, Oleksandr Bodriagov (Polystar)
>><ol...@polystar.com> wrote:
>> 
>> For some reason I cannot deploy target/fortress-rest.war in Tomcat
>>8.0.21.
>> I tried doing it manually by copying target/fortress-rest.war to webapps
>> in Tomcat because "mvn tomcat:deploy² returns
>> 
>> [ERROR] Failed to execute goal
>> org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on
>>project
>> fortress-rest: Cannot invoke Tomcat manager: Error writing to server ->
>> [Help 1]
>> 
>> If I do it manually I get the following error in catalina logs:
>> 
>> 21-Apr-2015 12:15:48.625 INFO [localhost-startStop-2]
>> org.apache.catalina.startup.HostConfig.deployWAR Deploying web
>>application
>> archive /usr/local/apache-tomcat-8.0.21/webapps/fortress-rest.war
>> 21-Apr-2015 12:15:48.629 WARNING [localhost-startStop-2]
>> org.apache.tomcat.util.digester.SetPropertiesRule.begin
>> [SetPropertiesRule]{Context/Realm} Setting property 'debug' to '0' did
>>not
>> find a matching property.
>> 21-Apr-2015 12:15:48.630 WARNING [localhost-startStop-2]
>> org.apache.tomcat.util.digester.SetPropertiesRule.begin
>> [SetPropertiesRule]{Context/Realm} Setting property 'resourceName' to
>> 'UserDatabase' did not find a matching property.
>> 
>
>From the error it looks like there are properties mapped from context.xml
>that conflict with the runtime.  Specifically resourceName and debug.
>Since fortress doesn’t use either, I have removed them from the
>context.xml for fortress-rest and tested for Tomcat 8.0.18.  If that
>doesn’t work let me know and I’ll try running on 8.0.21.
>
>Thanks 
>
>Shawn
>smckinney@apache.org