Jsp+Java application execution not working - java

I'm sorry of being so general, but I have a problem with my application execution and I have no idea of what it could be.
It's made by Jsp and Java parts, and developed with Eclipse. It uses a Postgresql database and an Apache Tomcat server.
When I click on Run As -> Run On Server, the program stops immediately. This is what Eclipse shows:
And this is what the console prints:
17-lug-2012 14.53.31 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:\Programmi\Java\jdk1.6.0_21\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Programmi/Java/jre6/bin/client;C:/Programmi/Java/jre6/bin;C:/Programmi/Java/jre6/lib/i386;C:\Programmi\CollabNet\Subversion
Client;C:\Programmi\MiKTeX
2.9\miktex\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
c:\Programmi\Microsoft
SQL
Server\90\Tools\binn\;C:\Programmi\Intel\DMIX;C:\Programmi\Intel\WiFi\bin\;C:\Programmi\MATLAB\R2010a\runtime\win32;C:\Programmi\MATLAB\R2010a\bin;C:\Programmi\File
comuni\Autodesk
Shared\;C:\Programmi\R-Language\R-2.13.1\bin\;C:\Programmi\R-Language\R-2.13.1\bin\;C:\Programmi\OpenVPN\bin\;
C:\Programmi\Java\jdk1.6.0_21\bin\ 17-lug-2012 14.53.31
org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA:
[SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
property 'source' to 'org.eclipse.jst.jee.server:BioTesiWeb' did not
find a matching property. 17-lug-2012 14.53.32
org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"] 17-lug-2012 14.53.32
org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 17-lug-2012 14.53.32
org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 460 ms 17-lug-2012 14.53.32
org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina 17-lug-2012 14.53.32
org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6 17-lug-2012 14.53.32
org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"] 17-lug-2012 14.53.32
org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 17-lug-2012 14.53.32
org.apache.catalina.startup.Catalina start
INFO: Server startup in 401
ms
Have you any idea of why the execution of the program fails?
Are there some libraries missing?
Have I forgot something?

Please give more details...
For now just Check ur Servlet mapping in web.xml ? And also the servlet is named correctly...
Take a look at the below links for the error your getting
https://stackoverflow.com/questions/2231163/what-tomcat-native-library-should-i-be-using-in-production
APR based Apache Tomcat Native library was not found on the java.library.path?

Related

Why my Tomcat 7 stop working after deploy

I have a grails app that runs on dev environment and I crated the war without problems.
In the server, I stop the service using "sudo service tomcat7 stop" command and put the war file into the server folder "/var/lib/tomcat7/webapps" and start the server again with the command "sudo service tomcat7 start".
For checking the state of the server I run "sudo service tomcat7 status" and get the "Tomcat servlet engine is running with pid 19169" response, and check if the application deploys correctly on the folder "/var/lib/tomcat7/webapps" and I see the project's folder there.
Right now, if I check the catalina.out file, I can't see any deploy error having this:
May 27, 2020 9:04:31 PM org.apache.coyote.AbstractProtocol init INFO:
Initializing ProtocolHandler ["http-bio-80"] May 27, 2020 9:04:31 PM
org.apache.catalina.startup.Catalina load INFO: Initialization
processed in 1280 ms May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardService startInternal INFO: Starting
service Catalina May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet Engine: Apache Tomcat/7.0.26 May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/docs.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/host-manager.xml May 27, 2020 9:04:33
PM org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/manager.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/examples.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web
application archive /var/lib/tomcat7/webapps/fleetcontroller.war
log4j:WARN No appenders could be found for logger
(net.bull.javamelody). log4j:WARN Please initialize the log4j system
properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
But if I wait a while, the tomcat service is stoped.
When I check the server status with "sudo service tomcat7 status" I get this msg
Tomcat servlet engine is not running, but pid file exists.
And the catalina.out show me:
WARN intercept.RequestmapFilterInvocationDefinition - Exception
initializing; this is ok if it's at startup and due to GORM not being
initialized yet since the first web request will re-initialize. Error
message is: {0} 2020-05-27 21:14:13,192 [pool-2-thread-1] WARN
module.ModuleDeclarationsFactory - resources artefact
KickstartResources does not define any modules | Using LESS files to
generating CSS files!
Please, if someone can help with that, because I don't know how to find the problem.
Really thanks for your time.
It was a virtual machine size problem.
I checked some server parameters and see that they was lower than production. infrastructure office changed the virtual server size and it starts to work!
Thanks you for your time!

Liferay 6.2 - tomcat bundle shutdown issue

I am running into an issue where I am unable to shutdown the Liferay 6.2 tomcat bundle on the server via the bundled shutdown script on the new linux server.
The steps I took are:
Installed the bundle by unziping it.
Uploaded the custom portal-ext.properties in the default liferay home folder
Change the memory args as defined in the deployment best practices guide in the tomcat home/bin/setenv.sh
Added Oracle custom data source in the tomcat home/conf/context.xml
JDK - jdk1.7.0_75
Navigate to the tomcat home/bin folder -> run ./startup.sh
Liferay and the bundle comes up.
To shutdown - Navigate to the tomcat home/bin folder -> run ./shutdown.sh
This displays the following but the tomcat is not shutdown:
$ ./shutdown.sh
Using CATALINA_BASE: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42
Using CATALINA_HOME: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42
Using CATALINA_TMPDIR: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/temp
Using JRE_HOME: /.../java/jdk1.7.0_75
Using CLASSPATH: /.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/bin/bootstrap.jar:/.../liferay-portal-6.2-ee-sp2/tomcat-7.0.42/bin/tomcat-juli.jar
I see the following in the Tomcat logs.
apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [org.python.google.common.base.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [MulticastListener-239.255.0.523305] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:23 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [pool-3-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:29 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/opensocial-portlet] appears to have started a thread named [com.google.inject.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Apr 27, 2015 1:18:45 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
The tomcat process is still showing after a few minutes as an active process and needs to be killed manually. Liferay seems to be down after the shutdown script is run within a minute or so.
I need this to work so all the resources are released cleanly and I can script the startup and shutdown as needed.
Has anyone seen this and resolved this behavior? Any insight would be much appreciated.
Thanks!
After working through this issue and following the steps below, the tomcat process shuts down within a minute or so with the shutdown script and there is no need to kill the process manually.
increased maxpermsize catalina_opts argument to 512m (was 200m) in the setenv.sh - this resolved 2 of the memory leak messages in the logs at shutdown and also resulted in the tomcat process shutdown properly.
removing the opensocial-portlet removed 1 memory leak error prior to the maxpermsize change but the process was still not shutdown properly.
there is 1 remaining memory leak error in the logs on shutdown but that for now is not preventing the tomcat from shutting down and seems to be part of tomcat not necessarily caused by liferay. This message for now seems safe to ignore per this LPS issue below
https://issues.liferay.com/browse/LPS-34498
Hope this helps someone.

Tomcat is automatically shutting down

I have installed Tomcat 7 with Java 7 on a debian box. It has 512 MB of RAM. I run tomcat out of the box, I have installed nothing, and it is consistently shutting down by itself. I am not even browsing the Tomcat landing page.
As you can see, it is running perfectly normal and then all of a sudden it stops:
Jul 21, 2013 6:11:20 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 21, 2013 6:11:20 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1063 ms
Jul 21, 2013 8:22:35 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jul 21, 2013 8:22:35 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jul 21, 2013 8:22:35 AM org.apache.catalina.core.StandardService stopInternal
It just mysteriously stops. What can it be? I know the Tomcat distribution and the Java distribution are good because I downloaded them from the Tomcat site and Oracle, and FTP'd them over to my server.
There are no other errors in any other tomcat log files. Is is a permissions thing? Memory issue? Appreciate your help.
I think a memory issue would show up in the log. I would simply reinstall Tomcat and check if it's still buggy.

Tomcat 7 not starting in Eclipse 4.2 (timeout). How to get more verbose output?

I am really struggling with an Eclipse project where Tomcat is giving me timeout. I thought at first this might be a mistake I did in some project configuration, so I reverted to an earlier version of my code. However this is still giving the same error! When I try to start a new project (Spring MVC) along the existing one, the new one seems to work fine and (if I disable the non-working one) the server now starts.
My question really is: How can I get more verbose output or log from Tomcat? The server telling me "it was unable to start within the time limit" does not really help me. Most of the solutions I have found for this kind of problem arent really solutions either, but "remove the server and add it again" or "Delete your eclipse workspace and start over again", etc. Is it really not possible to get Tomcat 7 to do some proper debug-logging to tell me whats going on?
The following is all the output I get:
mai 03, 2013 1:17:45 PM org.apache.catalina.core.AprLifecycleListener init
mai 03, 2013 1:17:46 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:kneip' did not find a matching property.
mai 03, 2013 1:17:46 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
mai 03, 2013 1:17:46 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
mai 03, 2013 1:17:46 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 666 ms
mai 03, 2013 1:17:46 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
mai 03, 2013 1:17:46 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
mai 03, 2013 1:17:57 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Fri May 03 13:17:57 CEST 2013]; root of context hierarchy
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Successfully resolved class for [net.krg.kneip.AppConfig]
INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#4cb8a2a9: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,appConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,camel,jmsConfig,activeMq,pooledConnectionFactory,jmsConnectionFactory,applicationContextProvider]; root of factory hierarchy
Thanks in advance!
In the end you need to increase the timeout limit for startup of tomcat from eclipse.
Double click on the Server ("Apache Tomcat") within the "Servers" view.
Open the "Timeouts" Section
increase "Start (in seconds)" to 120
(this does not lead to more log information, but it should solve your problem.)

HTTP Status 404 while trying to run my servlet

I have a dyanmic web project with a DAO FileDao in package de.vogella.wtp.filecounter.dao; and a servlet FileCounter in package de.vogella.wtp.filecounter.servlets; packages respectively.
I was trying to run the servlet and changed the ports 8088 since my 8080 is already occupied with some other application. When I run this servlet I get the below error in console:
Jun 1, 2012 2:39:13 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting propert
y 'source' to 'org.eclipse.jst.jee.server:de.vogella.wtp.filecounter' did not fi
nd a matching property.
Jun 1, 2012 2:39:13 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8088"]
Jun 1, 2012 2:39:13 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8010"]
Jun 1, 2012 2:39:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 380 ms
Jun 1, 2012 2:39:13 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 1, 2012 2:39:13 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Jun 1, 2012 2:39:13 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8088"]
Jun 1, 2012 2:39:13 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8010"]
Jun 1, 2012 2:39:13 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 260 ms
This is the error:
HTTP Status 404 - /de.vogella.wtp.filecounter/servlet/de.vogella.wtp.filecounter.servlets.FileCounter
--------------------------------------------------------------------------------
type Status report
message /de.vogella.wtp.filecounter/servlet/de.vogella.wtp.filecounter.servlets.FileCounter
description The requested resource (/de.vogella.wtp.filecounter/servlet/de.vogella.wtp.filecounter.servlets.FileCounter) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.27
Any guesses on what went wrong?
HTTP Error 404 means page or resources not found.
So you just typed incorrect URL. just check URL in web.xml and the URL typed in browser.
Here, maybe FileCounter class is misplaced. check it too.
I was doing the same tutorial and had the same problem. I guess it's a pretty common tutorial, so I'll leave my answer here.
In my installation, Eclipse does not create a web.xml by default. When creating a Servlet, Eclipse uses annotations for mapping. I accidentaly erased the annotation when copying the tutorial's code. I guess you did the same.
To solve it I included a #WebServlet annotation before the class. Like this:
#WebServlet("/FileCounter")
public class FileCounter extends HttpServlet {
...

Categories