[ 
https://issues.apache.org/jira/browse/ARTEMIS-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17161287#comment-17161287
 ] 

Stefan Buzoianu commented on ARTEMIS-2780:
------------------------------------------

I apologize for the delay but I wanted to do tests not only on 2.12 but also on 
2.14. I made a build compiled with OpenJDK on the Windows environment. 

For a few weeks I had the impression that this issue was resolved once this bug 
was resolved - https://issues.apache.org/jira/browse/ARTEMIS-2596. I suspected 
that our problem of deleting libraries was related to the cleanup procedure. 
After at least four weeks in which this bug - deleting the jars from the lib 
folder - did not reproduce in 2.1,  it appeared when a VM we were testing 
shutdown due to a windows update. 

 
{code:java}
2020-07-15 01:49:04,123 ERROR [org.apache.activemq.artemis.core.server] 
AMQ224068: Unable to stop component: 
org.apache.activemq.artemis.component.WebServerComponent: java.io.IOException: 
Cannot run program "C:\NAPA\Common\open-jre\bin\java": CreateProcess error=19, 
The media is write protected2020-07-15 01:49:04,123 ERROR 
[org.apache.activemq.artemis.core.server] AMQ224068: Unable to stop component: 
org.apache.activemq.artemis.component.WebServerComponent: java.io.IOException: 
Cannot run program "C:\NAPA\Common\open-jre\bin\java": CreateProcess error=19, 
The media is write protected at 
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) [rt.jar:1.8.0_232] at 
org.apache.activemq.artemis.utils.SpawnedVMSupport.spawnVM(SpawnedVMSupport.java:244)
 [artemis-commons-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.utils.SpawnedVMSupport.spawnVM(SpawnedVMSupport.java:130)
 [artemis-commons-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.utils.SpawnedVMSupport.spawnVM(SpawnedVMSupport.java:102)
 [artemis-commons-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.utils.SpawnedVMSupport.spawnVM(SpawnedVMSupport.java:70)
 [artemis-commons-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.utils.SpawnedVMSupport.spawnVM(SpawnedVMSupport.java:51)
 [artemis-commons-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.component.WebTmpCleaner.cleanupTmpFiles(WebTmpCleaner.java:77)
 [artemis-web-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.component.WebTmpCleaner.cleanupTmpFiles(WebTmpCleaner.java:66)
 [artemis-web-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.component.WebServerComponent.cleanupWebTemporaryFiles(WebServerComponent.java:318)
 [artemis-web-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.component.WebServerComponent.internalStop(WebServerComponent.java:269)
 [artemis-web-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.component.WebServerComponent.stop(WebServerComponent.java:358)
 [artemis-web-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1265)
 [artemis-server-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1033)
 [artemis-server-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:876)
 [artemis-server-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.integration.FileBroker.stop(FileBroker.java:98) 
[artemis-cli-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.cli.commands.Run.stop(Run.java:166) 
[artemis-cli-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT] at 
org.apache.activemq.artemis.cli.commands.Run$2.run(Run.java:157) 
[artemis-cli-2.14.0-SNAPSHOT.jar:2.14.0-SNAPSHOT]Caused by: 
java.io.IOException: CreateProcess error=19, The media is write protected at 
java.lang.ProcessImpl.create(Native Method) [rt.jar:1.8.0_232] at 
java.lang.ProcessImpl.<init>(ProcessImpl.java:444) [rt.jar:1.8.0_232] at 
java.lang.ProcessImpl.start(ProcessImpl.java:139) [rt.jar:1.8.0_232] at 
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) [rt.jar:1.8.0_232] ... 
16 more
{code}
If on 2.12 this issue when it appears leads to the deletion of all jars in 
libs, in this case, on 2.14, the jars in the lib folder have been partially 
deleted.
We added some logs on our version of 2.14 and noticed that the jars that were 
previously loaded in CLASSPATH are deleted:

 

[https://github.com/apache/activemq-artemis/blob/8fe1bb1c833e65a706423d332aa2abd5ae38d87b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java#L204]

My observation is that the jars are partially deleted because the child process 
that is created to do web tmp folder cleanup cannot successfully initialize due 
to the fact that the JVM is shutting down.

In this case I have two questions:

1. What are the implications for keeping the cleanup on start and eliminating 
it on stop? I did a test by adding a file and a folder in tmp folder. When the 
Artemis service is started, everything that exists in the tmp folder is deleted 
because _cleanupTmp():_

[https://github.com/apache/activemq-artemis/blob/91fc0c979f3357ac854c71b2560e6a45307e00b0/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java#L262]

2. Why do we have a stop cleanup as long as we have a startup? this stop 
cleanup involves, in certain situations, deleting the jars attached to the 
CLASSPATH from lib.
 

> Artemis Jar Files are automatically removed after abnormal system shutdown
> --------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2780
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2780
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Web Console
>    Affects Versions: 2.11.0
>         Environment: Artemis is configured to always use a personally built 
> OPEN JRE java (not using the default one)
>  * Artemis 2.11.0.
>  * Windows 10
>  * OpenJDK 1.8.0_66 (OPEN_JRE - C: \ work \ open-jre \)
>  * Oracle JDK 1.9.0_191 (Environment variable JAVA_HOME - C: \ Program Files 
> \ Java \ jdk1.8.0_191
>  
>            Reporter: Stefan Buzoianu
>            Priority: Critical
>         Attachments: ARTEMIS-2780.png, artemis-service.xml, artemis.cmd
>
>
> If you kill the server without invoking a normal shutdown, the contents of 
> the lib folder (ArtemisRootDir/lib) are removed. This makes Artemis Brokers 
> unable to start.
> My suspicion is that there is a certain incompatibility between my local 
> Windows resources and the way ActiveMQ Artemis is configured. Can you check 
> the attached files please?
>  
> I found this
> [https://github.com/apache/activemq-artemis/blob/a68381904f658dfb3765710ae63f7c79e038b1ed/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java#L192]
> Which apparently makes the java path to be set to java_home
> {code:java}
> final String javaPath = Paths.get(System.getProperty("java.home"), "bin", 
> "java").toAbsolutePath().toString();{code}
> But in my case, I actually start the application using Open Jre. (Please 
> check Environment details)
>  
>  
> I found some similarities in these issues
> https://issues.apache.org/jira/browse/ARTEMIS-2596
> https://issues.apache.org/jira/browse/ARTEMIS-1058
>   
>   
>   
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to