Error while deploying the solr service in tomcat - java

I am new to tomcat and solr . So solr is running on the tomcat server . When I run the tomcat using the sudo service tomcat7 start then it works perfectly,gets deployed properly. But when I am doing it from eclipse using the tomcat7:run goal then it is giving me some problems like -
ERROR UpdateLog:120 - Failure to open existing log file (non fatal) /opt/solr-tomcat/solr/collection1/data/tlog/tlog.0000000000000000146:org.apache.solr.common.SolrException: java.io.FileNotFoundException: /opt/solr-tomcat/solr/collection1/data/tlog/tlog.0000000000000000146 (Permission denied)
ERROR UpdateLog:1441 - Error deleting file: /opt/solr-tomcat/solr/collection1/data/tlog/tlog.0000000000000000146
2017-07-06 14:39:05 ERROR UpdateLog:120 - Failure to open existing log file (non fatal) /opt/solr-tomcat/solr/collection1/data/tlog/tlog.0000000000000000147:org.apache.solr.common.SolrException: java.io.FileNotFoundException: /opt/solr-tomcat/solr/collection1/data/tlog/tlog.0000000000000000147 (Permission denied)
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
Caused by: java.io.FileNotFoundException: /opt/solr-tomcat/solr/collection1/data/index/write.lock (Permission denied)
I changed the permission of that folder as well now it is a tomcat7.
In the solr-tomcat folder.
drwxr-xr-x 3 tomcat7 tomcat7 4096 Jul 6 14:11 solr/
-rw-r--r-- 1 tomcat7 tomcat7 2118 Jul 6 14:11 solr.xml
Can any one please help me with this ?

Solr 5.0+ Support for deploying Solr into servers (like tomcat )no longer supported.
Solr should be a standalone server, follow these steps

Related

Cannot start Apache application after deployment on Windows

Trying to deploy Midpoint OpenSource IDM software on Windows server
Runing JAVA 9.0.1 and Tomcat Apache 8.5
Deployment of the WAR file seems to succeed but application does not start
On Tomcat Web Application Manager I get the error:
FAIL - Application at context path [/midpoint] could not be started
In the Catalina logs all I can see is:
SEVERE [http-nio-8080-exec-38] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
SEVERE [http-nio-8080-exec-38] org.apache.catalina.core.StandardContext.startInternal Context [/midpoint] startup failed due to previous errors

Tomcat deleting important folders referenced by a symlink inside webapps

I have a maven application running on tomcat, I start it using cargo:
mvn cargo:run
Inside the webapps folder, there is a symlink that points to an important folder:
ls /usr/local/Cellar/tomcat/8.0.15/libexec/webapps/ROOT/WEB-INF/views
admin 898 Jul 21 2016 notImplemented.jsp
admin 3355 Oct 3 15:13 genericError.jsp
admin 41 Mar 21 18:43 vhosts -> /Users/me/Project/important/folder <<<<<< HERE
The problem is that when I start the server, tomcat follow the symlink and delete everything contained in the folder.
When I start tomcat via intellij, there is no issue. I noticed from the logs that the deletion is occurring at line 4 (Trying to delete WAR from /ROOT):
1 [INFO] [stalledLocalDeployer] Undeploying context [] from [/usr/local/Cellar/tomcat/8.0.15/libexec/webapps]...
2 [INFO] [stalledLocalDeployer] The WAR file has its context set to / and will therefore be deployed as ROOT.war
3 [INFO] [stalledLocalDeployer] Trying to delete WAR from [/usr/local/Cellar/tomcat/8.0.15/libexec/webapps/ROOT.war]...
4 [INFO] [stalledLocalDeployer] Trying to delete WAR from [/usr/local/Cellar/tomcat/8.0.15/libexec/webapps/ROOT]...
5 [INFO] [stalledLocalDeployer] Deploying [/Users/.....war] to [/usr/local/Cellar/tomcat/8.0.15/libexec/webapps]...
6 [INFO] [stalledLocalDeployer] The WAR file has its context set to / and will therefore be deployed as ROOT.war
I am running tomcat 8.0.15 on OSX 10.11.3 and use cargo-maven2-plugin v1.6.1.
Could you please suggest a solution to prevent symlinks content to be deleted when tomcat is starting ?
Thanks
Solution
At the end, I am deleting all the symlinks contained inside tomcat working directory before starting tomcat. It fixes the problem.
find ${TOMCAT_HOME}/webapps -type l -delete

Netbeans 8.1 + tomcat 8.0.39 build-impl.xml 1045 error

I get this error when I try to deploy my web application:
Deployment is in progress...
deploy?
config=file%3A%2FC%3A%2FUsers%2FEDGE%2FAppData%2FLocal%2FTemp%2Fcontext3172741505011533351.xml&path=/mywebapp
FAIL - Unable to create directory [C:\Program
Files\apache-tomcat-8.0.39\conf\Catalina\localhost]
C:\Users\EDGE\Documents\NetBeansProjects\mywebapp\nbproject\build-impl.xml:1045:
The module has not been deployed. See the server log for details.
BUILD FAILED (total time: 4 seconds)
How do go about solving this error??

How to deploy a Tomcat application with URL API when using custom context XML

My application context is defined as an XML file located in my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml.
<Context docBase='/my/path/to/myApp/myAppWarFile.war'>
<Environment name='my_config_dir' value='/my/path/to/myApp' type='java.lang.String'/>
</Context>
/my/path/to/myApp contains the WAR file myAppWarFile.war and a number of externalized properties that are read by Spring.
Tomcat is configured with autoDeploy turned off. When I start Tomcat, it creates my/path/to/Tomcat/conf/webapps/my-app/ and the WAR file gets unpacked into this location as expected, and the application of course can run as expected.
When I want to deploy a new version without restarting Tomcat, I run the undeploy command as follows:
curl http://localhost:8080/manager/text/undeploy?path=/my-app --user my-username:my-password
... and that works. But when I instruct Tomcat to deploy with the following curl statement, I get a failure.
curl http://localhost:8080/manager/text/deploy?config=file:/my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml --user my-username:my-password
# Tomcat response
FAIL - Invalid context path null was specified
Adding the path does not help much, I still get a failure.
curl http://localhost:8080/manager/text/deploy?config=file:/my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml\&path=/my-app --user my-username:my-password
# Tomcat response
FAIL - Failed to deploy application at context path /my-app
The worst part is that tailing catalina.out does not yield any insight. And on top of that, Tomcat deletes the application context XML file my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml!
Naturally I have reviewed Tomcat documentation (https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Deploy_using_a_Context_configuration_%22.xml%22_file) and I have googled all day to figure this out, but I have not found anything that can help me with this particular configuration.
It feels as though the choice is:
Tomcat with autoDeploy on (not recommended for production) in which case simply dropping the new WAR to /my/path/to/myApp/ will cause Tomcat to hot deploy the app.
Tomcat with autoDeploy off, but re-deploying requires a Tomcat restart because the deploy API does not seem to be working as advertised.
Has anybody made this work with this configuration?
EDIT:
I turned up the logging on Catalina. When I run the first deploy command without the path, I get this set of log entries:
FINE: Start processing with input [config=file:/my/apth/to/tomcat/conf/Catalina/localhost/my-app.xml]
Oct 13, 2015 10:04:53 AM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
FINE: Socket: [org.apache.tomcat.util.net.SocketWrapper#189651c1:Socket[addr=/0:0:0:0:0:0:0:1,port=45415,localport=8080]], Status in: [OPEN_READ], State out: [OPEN]
Oct 13, 2015 10:04:53 AM org.apache.coyote.http11.AbstractHttp11Processor process
FINE: Error parsing HTTP request header
java.io.EOFException: Unexpected EOF read on the socket
at org.apache.coyote.http11.Http11Processor.setRequestLineReadTimeout(Http11Processor.java:168)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:982)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
Oct 13, 2015 10:04:53 AM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
FINE: Socket: [org.apache.tomcat.util.net.SocketWrapper#189651c1:Socket[addr=/0:0:0:0:0:0:0:1,port=45415,localport=8080]], Status in: [OPEN_READ], State out: [CLOSED]
Oct 13, 2015 10:04:53 AM org.apache.tomcat.util.threads.LimitLatch countDown
FINE: Counting down[http-bio-8080-exec-16] latch=1
Have you tried:
curl --upload-file /my/path/to/my-app.war http://localhost:8080/manager/text/deploy?path=/my-app --user my-username:my-password

Tomee Server :java.net.ConnectException: Connection refused: connect

I am trying to deploy my webservice on tomee server.
When I use maven goal as "tomme:run" to start the server, it gives the following error:
[INFO] Running 'run'. Configured TomEE in plugin is localhost:8080 (plugin shutdown port is 8005)
EError opening zip file or JAR rror occurred during initialization of VM
agent library failed to init: instrument
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
manifest missing : C:\Documents
[INFO] Total time: 30.844s
[INFO] Finished at: Thu Nov 01 17:36:15 IST 2012
[INFO] Final Memory: 10M/26M
[INFO] ------------------------------------------------------------------------
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at org.apache.openejb.config.RemoteServer.stop(RemoteServer.java:366)
at org.apache.openejb.maven.plugin.AbstractTomEEMojo$2.run(AbstractTomEEMojo.java:568)
But if I use startup.bat file to start the server , everything works fine.
Does anybody has any idea for this issue?
This seems a bit old but just in case if it helps.
It seems that when you are using the tomee plugin failed to start the server at the first place, and that is the reason for the connection refused issue. Because it tries to connect to the shutdown port to shutdown the server but obviously it is not available as the server never started.
So you should focus on "Error opening zip file or JAR rror occurred during initialization of VM agent library failed to init: instrument". By any chance, the artifact in your local maven repo can be corrupt ?
Best Regards,
Nandana
Not precisely the same situation, but I encountered this error:
"Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file or JAR manifest missing : C:apache-tomee-plus-1.5.2/lib/openejb-javaagent.jar
when I tried to fire up TomEE as "./catalina.sh start" in a Cygwin terminal on my Windows box. Same result whether I tried a new complete TomEE or an already-existing Tomcat with the TomEE war. Works fine when I use the batch file in a Windows terminal as "catalina start". I don't really care enough to chase the issue further, but it appears that Tommy likes you to use a native shell.

Categories