I've put the file apache-solr-3.5.0.war in folder C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps.
A folder "apache-solr-3.5.0" is created automatically. And when I go to: http://localhost:8080/apache-solr-3.5.0/ .
I can see the message "Welcome to Solr!".
Now, when I do the exact same with the file solr-4.3.1.war in the folder C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
A folder solr-4.3.1 is created automatically. But now when I go to:
http://localhost:8080/solr-4.3.1/ OR to http://localhost:8080/solr-4.3.1/admin.html
I see the error:
HTTP Status 404 - type Status report
Message: description The requested resource is not available.
Apache Tomcat/6.0.37
What am I missing?
Update:
This is shown in the Tomcat console window:
INFO: Solr
home set to 'solr/' 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader <init> INFO: Solr home set to
'solr\.\' 12-jul-2013 18:27:36 org.apache.solr.common.SolrException
log SEVERE: java.lang.RuntimeException: Can't find resource
'solrconfig.xml' in class sath or 'solr\.\conf/', cwd=C:\Program
Files\Apache Software Foundation\Tomcat
6.0
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoad
er.java:268)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=C:\Program Files\Apache Software Foundation\Tomcat 6.0
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done 12-jul-2013 18:27:36
org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init()
12-jul-2013 18:27:36 org.apache.solr.core.SolrResourceLoader
locateSolrHome INFO: No /solr/home in JNDI 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home
defaulted to 'solr/' (could not find system property or JNDI)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrServlet init INFO:
SolrServlet.init() done 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No
/solr/home in JNDI 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home
defaulted to 'solr/' (could not find system property or JNDI)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done 12-jul-2013 18:27:36
org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web
application archive solr-4.3.1.war 12-jul-2013 18:27:36
org.apache.catalina.core.StandardContext start SEVERE: Error
filterStart 12-jul-2013 18:27:36
org.apache.catalina.core.StandardContext start SEVERE: Context
[/solr-4.3.1] startup failed due to previous errors 12-jul-2013
18:27:36 org.apache.catalina.startup.HostConfig deployDirectory INFO:
Deploying web application directory ROOT 12-jul-2013 18:27:36
org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote
HTTP/1.1 on http-8080 12-jul-2013 18:27:36
org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on
/0.0.0.0:8009 12-jul-2013 18:27:36 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/56 config=null 12-jul-2013 18:27:36
org.apache.catalina.startup.Catalina start INFO: Server startup in 880
ms
My unpacked Solr folder contains these folders:
css
img
js
META-INF
tpl
WEB-INF
Update
After adding this to my environment variables:
JAVA_OPTS = $JAVA_OPTS -Dsolr.solr.home=C:/Databases/solr-4.3.1/example/solr
I get these 2 errors after startup:
SEVERE: org.apache.solr.common.SolrException: Invalid luceneMatchVersion 'LUCENE_43', valid values are: [LUCENE_20, LUCENE_21, LUCENE_22, LUCENE_23, LUCENE_24,LUCENE_29, LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34,LUCENE_35, LUCENE_CURRENT] or a string in format 'V.V'
SEVERE: Exception starting filter SolrRequestFilter org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used.
Full log:
SEVERE: org.apache.solr.common.SolrException: Invalid luceneMatchVersion 'LUCENE _43', valid values are: [LUCENE_20, LUCENE_21, LUCENE_22, LUCENE_23, LUCENE_24, LUCENE_29, LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34, LUCENE_35, LUC ENE_CURRENT] or a string in format 'V.V'
at org.apache.solr.core.Config.parseLuceneVersionString(Config.java:353)
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrDispatchFilter init INFO: user.dir=C:\Program Files\Apache Software Foundation\Tomcat 6.0
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrDispatchFilter init INFO: SolrDispatchFilter.init() done 13-jul-2013 13:46:02 org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init()
13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No /solr/home in JNDI 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: using system property solr.solr.home: C:\Databases\solr-4.3.1\exam ple\solr
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init() done 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No /solr/home in JNDI 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: using system property solr.solr.home: C:\Databases\solr-4.3.1\exam ple\solr
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrUpdateServlet init INFO: SolrUpdateServlet.init() done
13-jul-2013 13:46:02 org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive solr-4.3.1.war 13-jul-2013 13:46:03 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter SolrRequestFilter org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jar s. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext direct ory. For other containers, the corresponding
directory should be used. For more information, see:
http://wiki.apache.org/solr/SolrLogging
UPDATE 3
I'm now getting a "HTTP Status 503 - Server is shutting down" error.
14-jul-2013 14:21:57 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat 6.0\bin;C:\Windows\Sun\Java\bin;C:\Windo
ws\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Li
ve;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\
system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShe
ll\v1.0\;C:\Program Files\TortoiseSVN\bin;c:\msxsl;C:\Program Files (x86)\Window
s Live\Shared;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program File
s (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows
Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110
\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Prog
ram Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQ
L Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL S
erver\110\DTS\Binn\;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files\Java\j
re631\bin;.
14-jul-2013 14:21:57 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
14-jul-2013 14:21:57 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 283 ms
14-jul-2013 14:21:57 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
14-jul-2013 14:21:57 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
14-jul-2013 14:21:57 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
14-jul-2013 14:21:57 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive solr-4.3.1.war
log4j:WARN No appenders could be found for logger (org.apache.solr.servlet.SolrD
ispatchFilter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
14-jul-2013 14:21:58 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
14-jul-2013 14:21:58 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
14-jul-2013 14:21:58 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
14-jul-2013 14:21:58 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/55 config=null
14-jul-2013 14:21:58 org.apache.catalina.startup.Catalina start
INFO: Server startup in 719 ms
I read something on this error here, but after adding my logging.properties.
Install Solr in Tomcat
Pre Requirements
1 – Machine with Windows OS (Windows 7,8,Xp.. ..etc)
2 – Java 6 or Above
3 - Solr 4.0.0 or Above
4 – Apache-tomcat 6 or Above.
Steps to get Solr up on Tomcat Server
1.Install Tomcat on your machine and make sure it is ready to start.(Check using localhost:8080)
2.Install Solr4.0 distribution package apache-solr-4.0.0.zip and unzip it in your local directory like C:\apache-solr-4.0.0.
3.Make a folder with name solr-home in your local machine like C:\solr_home.
4.Go back to the solr distribution package that you downloaded C:\apache-solr-4.0.0. Have a peek inside the Examples/solr ("C:\solr-4.4.0\example\solr") folder. Copy all those files into the C:\solr_home folder.(server shutting down exception will come)
5.Look into C:\solr-home\solr and you will see two folders with name collection1 and bin, copy these two folders a step up to C:\solr_home.(if lib not copy "severe error filterstart" Exception come)
6.Copy lib from C:\apache-solr-4.0.0\example\lib\ext SLF4J and log4j.jar file to Tomcat Lib folder C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib
(https://wiki.apache.org/solr/SolrLogging#Using_the_example_logging_setup_in_containers_other_than_Jetty)
7.Copy apache-solr-4.0.war (rename to solr.war) from "C:\solr-4.4.0\dist" directory to webapps directory inside Tomcat.(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps)
8.If tomact is already start then solr folder will create go to "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\solr\WEB-INF\web.xml" edit web.xml
uncomment entry and edit like following(Exception SolrCore 'collection1' is not available due to init failure)
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:\solr_home\solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
9.Start Tomcat and check localhost:8080/solr dashBoard will come
It got solved for me by on a different forum, here are the steps I followed:
Extract solr431 package. In my case I did in
"E:\solr-4.3.1\example\solr"
Now copied solr dir from extracted package (E:\solr-4.3.1\example\solr)
into TOMCAT_HOME dir.
In my case TOMCAT_HOME dir is pointed to E:\Apache\Tomcat 6.0.
I can refer now SOLR_HOME as " E:\Apache\Tomcat 6.0\solr" (please
remember this)
Copy the solr.war file from extracted package to SOLR HOME dir i.e
E:\Apache\Tomcat 6.0\solr. This is required to create the context. As I
donot want to pass this as JAVA OPTS
Also copy solr.war file into TOMCAT_HOME\webapps for deployment purpose
If you start tomcat you will get errors as mentioned by Shawn. S0 you
need to copy all the 5 jar files from solr extracted package (
E:\solr-4.3.1\example\lib\ext ) to TOMCAT_HOME\lib dir:
jul-to-slf4j-1.6.6,
jcl-over-slf4j-1.6.6,
slf4j-log4j12-1.6.6,
slf4j-api-1.6.6,
log4j-1.2.16
Also copy the log4js.properties file from
E:\solr-4.3.1\example\resources dir to TOMCAT_HOME\lib dir.
Now if you start the tomcat you wont having any problem.
The way that logging works with Solr was updated with Solr 4.3.0 (and higher). If you check your Tomcat logs you will most likely see a "Filter Exception" error. Please refer to the Solr Logging - Using the example logging setup in containers other than Jetty for the steps required to get Solr 4.3.0 and higher to run on Tomcat.
According to my notes (I did that procedure some time ago), I had to add an extra line in the Tomcat "caralina.sh" (or catalina.bat if you use windows):
export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example/solr"
This is used to specify where the solr "configuration" and "data" directories (where your data will be stored). In my case it is "/opt/solr/example/solr", but you need to use the directory where you have the "configuration" files and "data" directory in your system. For example you should use "C:\solr-4.3.1\examples\solr\" if you extracted the downloaded Solr package in C: in windows. This means, that you will deploy the "Solr.war" in Tomcat (you already did that), but the configuration of Solr and "data" stored will be in that directory you specify in catalina.bat (JAVA_OPS, e.g.: C:\solr-4.3.1\examples\solr).
Good instructions to install Solr in a Tomcat in windows: http://liuweipingblog.cn/java/install-lucene-solar-with-tomcat-on-windows/
This error is occurred due to the separate logging mechanism of solr. After researching I have found that, you need to add slf4j log jar in your tomcat lib. ( as per my local machine it is : C:\xampp\tomcat\lib )
download from below url and copy the jar file in tomcat lib
http://www.slf4j.org/download.html
After doing the above step it is working fine in my local system.
The errors about the lucene version indicate that you are still deploying the 3.5 version. I mean, I'm sure you put the 4.x war but for somewhat reason (forgot to delete the war, tmp files) the 3.5 is still there.
When you indicates the solr.home using a system property it will be read by "all" solr you are deploying.
So in your case, the 4.3.1 is happy about the given solr home (which contains LUCENE43) but the 3.5 throws the exception (4.3 is unknown to 3.5)
It includes few steps
Download solr-XXX.zip and extract into solr-XXX.
Copy solr-XXX.war (from solr-XXX/dist folder after unzipping the .zip) into Tomcat/webapps. Then unzip the .war file (using WinZip etc.). This will create folder solr-XXX. Copy log4j-XXX.jar,slf4j-api-XXX.jar,slf4j-log4j12-XXX.jar,commons-logging-XXX.jar into Tomcat/webapps/solr-XXX/WEB-INF/lib. And create a folder Tomcat/webapps/solr-XXX/WEB-INF/classes and copy log4j.properties here from solr-XXX\example\resources
Create a directory MySolrHome anywhere and copy content of solr-XXX\example\solr folder here
Add JAVA_OPTS=-Dsolr.solr.home=Path/to/MySolrHome/
Start Tomcat
Related
Am trying to load spring batch job context file on deployment of war.
I have added contextConfigLocation as below but not working.Even added spring-web in pom.xml but still when i deploy my war application onto tomcat spring is not being initialized.Please help me since i have referred to most of SO and spring forums answers,i dont want to use dispatcher servlet since this is not a web application as of now .It is just a batch job but in future it will be a batch job + web application ,at that time i will have a dispatcher servlet .Please let me know how to load spring on server start up.
My git repository where full code is present
https://github.com/sumateja/patternfinder
https://github.com/sumateja/patternfinder.git
tomcat logs
Dec 25, 2015 12:20:59 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Development\apache-maven-3.1.1\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\MySQL\MySQL Enterprise Backup 3.12\;C:\Program Files\Git\cmd;C:\Ruby21-x64\bin;C:\Users\Tejas\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Tejas\AppData\Local\Programs\Python\Python35-32\;C:\Users\Tejas\AppData\Local\Programs\Python\Launcher\;C:\Users\Tejas\AppData\Roaming\npm;C:\Program Files\Git\bin;.
Dec 25, 2015 12:20:59 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:patternfinder' did not find a matching property.
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9090"]
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-9009"]
Dec 25, 2015 12:20:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 548 ms
Dec 25, 2015 12:20:59 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 25, 2015 12:20:59 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9090"]
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-9009"]
Dec 25, 2015 12:20:59 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 547 ms
web.xml
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:equity-eod-job.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
I cloned your project on my machine. I did "mvn clean package". When I was about to copy the war file from target folder to tomcat webapps folder, I noticed that you are packaging it as jar instead of war. :)
change in your pom.xml, value of packaging from jar to war :
<modelVersion>4.0.0</modelVersion>
<groupId>patternfinder</groupId>
<artifactId>patternfinder</artifactId>
<packaging>war</packaging> <!-- This line from jar to war-->
<version>1.0</version>
<name>patternfinder</name>
After this do:
mvn clean package
copy target/patternfinder-1.0.war to tomcat webapp folder
start tomcat
now you can see that your application will start loading. seems there is a wrong file path, in logs you can find FileNotFoundException occurring. I hope you can resolve this.
Yes finally this got solved . It seems that my web.xml was not being picked up ,since openshift had put the web.xml in webapps folder.Hence deleted this folder after copying WEB-INF folder to WebContent.When we download a project created in openshift into our workspace ,web.xml is present in webapps folder.Thanks prem for your help.
Till now i was using tomcat 7.0.34 and my spring application was loading perfectly. Yesterday i decided to use 7.0.47 and the container is not loading anymore my application. If i switch back to 34 version it works again. I tested on 7.0.52 and the same problem is there.
Not sure what can be the issue.
StackTrace
Mrz 28, 2014 11:03:28 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;d:\imagemagick-6.3.9-q8;C:\Program Files\ImageMagick-6.8.8-Q16;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM FILES\THINKPAD\BLUETOOTH SOFTWARE\;C:\PROGRAM FILES\THINKPAD\BLUETOOTH SOFTWARE\SYSWOW64;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Microsoft Network Monitor 3\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Java\jdk1.7.0_51;D:\apache-cassandra-2.0.5;D:\maven/bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;.
Mrz 28, 2014 11:03:28 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:daydiary' did not find a matching property.
Mrz 28, 2014 11:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mrz 28, 2014 11:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mrz 28, 2014 11:03:28 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 756 ms
Mrz 28, 2014 11:03:28 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mrz 28, 2014 11:03:28 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Mrz 28, 2014 11:03:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mrz 28, 2014 11:03:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mrz 28, 2014 11:03:30 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2201 ms
The problem i see is my WebApplicationInitializer implementation is not detected somehow. What can be the cause for this.?
I am using JDK 7 , spring 4.0.2
Oh man !.... I just deleted the web.xml file and the WebApplicationInitializer is now loaded.
Previously i had both of them. Just not sure if you can have both with this kind of configuration but looks like you cannot....
I've run this project previously in STS but am trying to replicate it in Eclipse 4.2 to no luck. I'm running the same Spring XML-free base setup as described http://blog.codeleak.pl/2011/06/spring-31-mvc-xml-free-configuration-in.html .
I'm using maven 3 embedded in Eclipse 4.2 and an embedded tomcat 7.
When I start the project up on tomcat 7.0.12...
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin/client;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/lib/i386;C:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Dell\DW WLAN Card;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\Security Innovation\SI TSS\bin\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Apache\apache-maven-3.0.5\bin;C:\Program Files (x86)\Git\cmd;C:\Development\eclipse-4.2_x86;;.
Aug 05, 2013 1:04:29 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:inst_tdcsim_server' did not find a matching property.
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 422 ms
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 259 ms
No mention of mappings being registered and no URL works, just 404s.
I tried changing the context root in Eclipse and the Tomcat server xml to '/' and that dind't help either.
I tried setting debug points in the code and nothing stops.
I tried setting all logging to 'ALL' after I brought in log4j, nothing shows.
I tried creating a blatant nullpointerexception on the first line of the onStartup method and nothing.
How is this spring app not responding to anything I try to do to get a response?
Any help would be hugely appreciated.
The solution involved Eclipse not deploying the assembly correctly.
Goto properties on the project -> Deployment Assembly -> Added "/src/main/java" deployed to "WEB-INF/classes" and then it picked up my Initializer. Not sure why this wasn't there to begin with.
I'm new to Liferay developing and I’m facing troubles with the startup of my Liferay Tomcat server. It takes almost 3 minutes (169048 ms) which is unacceptable for development. I’d like to get it down to about one minute.
Here are the specs of my machine:
Intel Core Duo T2300 # 1.66GHz
4GB RAM (3.24GB in use)
Windows 7 Enterprise 32 bit with Service Pack 1
I’m using:
Liferay 6.1.1-ce-ga2 bundled with Tomcat 7
Eclipse IDE Juno Release
In order to speed things up, I’ve:
removed all unnecessary portlets from the tomcat\webapps folder.
put the Tomcat native library 1.1.24 in the tomcat\bin folder
tweaked my portal-ext.properties as shown below
#disable some filters
com.liferay.portal.servlet.filters.sso.cas.CASFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter = false
com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter= false
com.liferay.portal.sharepoint.SharepointFilter = false
com.liferay.portal.servlet.filters.gzip.GZipFilter = false
#disable indexing
index.on.startup=false
Here’s my startup log:
Jan 30, 2013 8:39:49 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.24.
Jan 30, 2013 8:39:49 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Jan 30, 2013 8:39:51 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Jan 30, 2013 8:39:51 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2620 ms
Jan 30, 2013 8:39:51 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 30, 2013 8:39:51 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\conf\Catalina\localhost\Hi-portlet.xml
Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\Hi-portlet inside the host appBase has been specified, and will be ignored
Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Hi-portlet' did not find a matching property.
Jan 30, 2013 8:39:52 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\conf\Catalina\localhost\ROOT.xml
Loading jar:file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/portal-ide.properties
Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-developer.properties
Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/portal-ext.properties
Jan 30, 2013 8:39:59 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
08:40:16,321 INFO [pool-2-thread-1][DialectDetector:71] Determine dialect for HSQL Database Engine 2
08:40:16,330 WARN [pool-2-thread-1][DialectDetector:86] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demo'ing purposes. The database settings can be changed in portal-ext.properties.
08:40:16,484 INFO [pool-2-thread-1][DialectDetector:136] Found dialect org.hibernate.dialect.HSQLDialect
Starting Liferay Portal Community Edition 6.1.1 CE GA2 (Paton / Build 6101 / July 31, 2012)
08:41:36,974 INFO [pool-2-thread-1][BaseDB:452] Database supports case sensitive queries
08:41:37,828 INFO [pool-2-thread-1][ServerDetector:154] Server supports hot deploy
08:41:37,850 INFO [pool-2-thread-1][PluginPackageUtil:1030] Reading plugin package for the root context
08:42:19,657 INFO [pool-2-thread-1][AutoDeployDir:106] Auto deploy scanner started for C:\Liferay\portal-6.1.1-ce-ga2\deploy
08:42:24,410 INFO [pool-2-thread-1][HotDeployImpl:178] Deploying Hi-portlet from queue
08:42:24,415 INFO [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for Hi-portlet
Jan 30, 2013 8:42:24 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 30, 2013 8:42:30 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Remoting Servlet'
Jan 30, 2013 8:42:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\resources-importer-web
08:42:35,522 INFO [pool-2-thread-1][HotDeployImpl:178] Deploying resources-importer-web from queue
08:42:35,523 INFO [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for resources-importer-web
Jan 30, 2013 8:42:36 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 30, 2013 8:42:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\welcome-theme
08:42:36,609 INFO [pool-2-thread-1][HotDeployEvent:109] Plugin welcome-theme requires resources-importer-web
08:42:37,305 INFO [pool-2-thread-1][HotDeployImpl:178] Deploying welcome-theme from queue
08:42:37,306 INFO [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for welcome-theme
Jan 30, 2013 8:42:37 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
08:42:37,787 INFO [pool-2-thread-1][ThemeHotDeployListener:87] Registering themes for welcome-theme
08:42:39,764 INFO [pool-2-thread-1][ThemeHotDeployListener:100] 1 theme for welcome-theme is available for use
Jan 30, 2013 8:42:40 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
08:42:40,167 INFO [liferay/hot_deploy-1][HotDeployMessageListener:142] Group or layout set prototype already exists for company liferay.com
Jan 30, 2013 8:42:40 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jan 30, 2013 8:42:40 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 169048 ms
Any suggestions?
The comments already gave some hints. I'd say, the most important issue is to check if virtual memory (paging) is used - as soon as the OS has to page memory to disk, you have lost: There's a potentially huge performance hit.
When you upgrade your memory (e.g. if you hit the virtual memory) you might want to consider upgrading the OS to a 64bit OS - 32bit can only address 4G and you might hit limits with appserver memory as each process can only get a limited amount of memory.
You could also test if Liferay starts up faster before you run so many other applications - this is another hint that you're running into a memory issue.
The SSD option will further accelerate your system, but for a much higher price than RAM. Also, virtual memory on SSD is not really recommended - it will wear out the drive quicker. And instead of using virtual memory on SSD, rather don't use virtual memory - this will be quicker AND cheaper.
This problem is solved by upgrading to Liferay 7.
While Liferay 7 does not start faster, developers really never need to restart it, as everything can be overridden by deploying new OSGi components. That is actually the biggest difference between Liferay 6 and Liferay 7.
I have been developing for Liferay 7 for 3 months, including very deep customization (for instance intercepting all file reads for audit), and have never needed to restart the Liferay server.
The server speed depends so much on a well configured JVM (memory, garbage collector type, etc) and Tomcat connector thread pool. depending of available server resources. Liferay provide a recommended configuration:
`-server -XX:NewSize=1024m -XX:MaxNewSize=1024m -Xms4096m
-Xmx4096m -XX:MetaspaceSize=300m -XX:MaxMetaspaceSize=300m
-XX:SurvivorRatio=12 –XX:TargetSurvivorRatio=90 –
XX:MaxTenuringThreshold=15 -XX:+UseLargePages
-XX:LargePageSizeInBytes=256m -XX:+UseParNewGC
-XX:ParallelGCThreads=16 -XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled -XX:+CMSCompactWhenClearAllSoftRefs
-XX:CMSInitiatingOccupancyFraction=85 -XX:+CMSScavengeBeforeRemark
-XX:+UseLargePages -XX:LargePageSizeInBytes=256m
-XX:+UseCompressedOops -XX:+DisableExplicitGC -XX:-UseBiasedLocking
-XX:+BindGCTaskThreadsToCPUs -XX:+UseFastAccessorMethods
-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=96m`
The above JVM settings should formulate a starting point for your
performance tuning. Each system’s final parameters will vary due to a variety of
factors including number of current users and transaction speed.
In tomcat servers you define this configuration like CATALINA_OPTS environment variable in /[tomcat_server]/bin/setenv.[sh or bat] file.
After deploying a web application, my Tomcat 7 server doesn't start anymore, signaling an exception during startup process.
So I tried to configure Tomcat to avoid to deploy the webapps at startup.
To do so, I've modified my ${CATALINA_BASE}/conf/server.xml and add an autoDeploy="false" attribute to the Host node. (I've also verified that there are no liveDeploy attributes):
<Host appBase="webapps" autoDeploy="false" name="localhost" unpackWARs="true">
...
then I read about liveDeploy attribute with a slightly different behaviour, and to be sure I disabled it too:
<Host appBase="webapps" autoDeploy="false" liveDeploy = "false" name="localhost" unpackWARs="true">
...
The problem is that it seems to do nothing, and in the outuput I still see "Deploying configuration descriptor" lines, till the one that crashes Tomcat.
Here there is the server output; I've include the startup, a first application (MyFirstApplication) that is deployed correctly, and the last one that crashses the server.
Using CATALINA_BASE: "C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11"
Using CATALINA_TMPDIR: "C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\temp"
Using JRE_HOME: "C:\Program Files (x86)\Java\jdk1.7.0"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin\tomcat-juli.jar"
gen 14, 2013 3:08:28 PM org.apache.catalina.core.AprLifecycleListener init
Informazioni: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files (x86)\CollabNet\Subversion Client;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files\Java\jdk1.6.0_23\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\spring-roo-1.1.4.RELEASE\bin;C:\Program Files\NetBeans 6.9.1\java\ant\bin;C:\Program Files (x86)\GNU\GnuPG\pub;C:\Program Files (x86)\QuickTime\QTSystem\;c:\Program Files\NetBeans 7.2\java\maven\bin;C:\Program Files (x86)\Nmap;C:\cmdutilities;.
gen 14, 2013 3:08:28 PM org.apache.coyote.AbstractProtocolHandler init
Informazioni: Initializing ProtocolHandler ["http-bio-8084"]
gen 14, 2013 3:08:28 PM org.apache.coyote.AbstractProtocolHandler init
Informazioni: Initializing ProtocolHandler ["ajp-bio-8009"]
gen 14, 2013 3:08:28 PM org.apache.catalina.startup.Catalina load
Informazioni: Initialization processed in 411 ms
gen 14, 2013 3:08:28 PM org.apache.catalina.core.StandardService startInternal
Informazioni: Starting service Catalina
gen 14, 2013 3:08:28 PM org.apache.catalina.core.StandardEngine startInternal
Informazioni: Starting Servlet Engine: Apache Tomcat/7.0.11
gen 14, 2013 3:08:28 PM org.apache.catalina.startup.HostConfig deployDescriptor
Informazioni: Deploying configuration descriptor MyFirstWebApp.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
gen 14, 2013 3:08:38 PM org.springframework.web.context.ContextLoader initWebApplicationContext
Informazioni: Root WebApplicationContext: initialization started
[...]
Informazioni: Deploying configuration descriptor manager.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
gen 14, 2013 3:08:40 PM org.apache.catalina.startup.HostConfig deployDescriptor
Informazioni: Deploying configuration descriptor MavenSpringHibernate.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
Exception in thread "main" Exception in thread "Thread-1"
You want set deployOnStartup, not autoDeploy (or possibly both). There is no such setting of liveDeploy.
From the Tomcat 7 docs for Host [1]
autoDeploy
This flag value indicates if Tomcat should check periodically for new
or updated web applications while Tomcat is running. If true, Tomcat
periodically checks the appBase and xmlBase directories and deploys
any new web applications or context XML descriptors found. Updated web
applications or context XML descriptors will trigger a reload of the
web application. The flag's value defaults to true. See Automatic
Application Deployment for more information.
deployOnStartup
This flag value indicates if web applications from this host should be
automatically deployed when Tomcat starts. The flag's value defaults
to true. See Automatic Application Deployment for more information.
[1] http://tomcat.apache.org/tomcat-7.0-doc/config/host.html