Tomcat - The requested resource () is not available

Hi,

I get this message when I try to start my small test project with Vaadin component on TOmcat server. Funny thing is that It had worked and without any changes at those project or tomcat settings it stopped ??

I read every comment on the net that there is, but hasn’t helped. Here is Java code:

package com.example.test1_vaadin;

import com.vaadin.Application;
import com.vaadin.ui.*;

public class Test1_vaadinApplication extends Application {
@Override
public void init() {
Window mainWindow = new Window(“Test1_vaadin Application”);
Label label = new Label(“Hello Vaadin user”);
mainWindow.addComponent(label);
setMainWindow(mainWindow);
}
}
And here is web.xml for this application:

<?xml version="1.0" encoding="UTF-8"?> Test1_Vaadin Vaadin production mode productionMode false Test1_vaadin Application com.vaadin.terminal.gwt.server.ApplicationServlet Vaadin application class to start application com.example.test1_vaadin.Test1_vaadinApplication Test1_vaadin Application /* index.html index.htm index.jsp default.html default.htm default.jsp

Here is also console output that I get in Eclipse when Tomcat is started. I might say that starting Tomcat in console outsice Eclipce works smoothly. OS in Mac OS X:

21.12.2010 14:49:57 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: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
21.12.2010 14:49:57 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]
{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.j2ee.server:Test1_Vaadin’ did not find a matching property.
21.12.2010 14:49:57 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]
{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:Test2_Vaadin’ did not find a matching property.
21.12.2010 14:49:57 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]
{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.j2ee.server:simpleaddressbook’ did not find a matching property.
21.12.2010 14:49:57 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-1971
21.12.2010 14:49:57 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 640 ms
21.12.2010 14:49:57 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
21.12.2010 14:49:57 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
21.12.2010 14:49:57 org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:959)
at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.ContextConfig.processDefaultWebConfig(ContextConfig.java:687)
at org.apache.catalina.startup.ContextConfig.defaultWebConfig(ContextConfig.java:624)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1075)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4540)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2671)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2651)
… 38 more
21.12.2010 14:49:57 org.apache.catalina.startup.ContextConfig processDefaultWebConfig
SEVERE: Parse error in default web.xml
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2806)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2832)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.ContextConfig.processDefaultWebConfig(ContextConfig.java:687)
at org.apache.catalina.startup.ContextConfig.defaultWebConfig(ContextConfig.java:624)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1075)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4540)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2671)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2651)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:959)
at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
… 30 more
21.12.2010 14:49:57 org.apache.catalina.startup.ContextConfig processDefaultWebConfig
SEVERE: Occurred at line 386 column 23
21.12.2010 14:49:57 org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
21.12.2010 14:49:57 org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
21.12.2010 14:49:57 org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
21.12.2010 14:49:57 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application appears to have started a thread named [Poller SunPKCS11-Darwin]
but has failed to stop it. This is very likely to create a memory leak.

Can anybody help me, please?

Please, some help from anyone, I’m stucked at the beginning…

Have you tried to remove tomcat from the server view, reinstall the tomcat files, and add the server back to the server view?

First try “Clean working directories” (I cannot recall the exact context menu item name in Eclipse) if you haven’t already - Tomcat often leaves problematic data in its working directories, at least when redeploying in Eclipse.

If you are running the Tomcat instance outside of Eclipse, clean any relevant working directories by hand.

Hi, Iam just starting and get a similar problem

With a very simple project

Label label = new Label(“Hello Vaadin user”);
mainWindow.addComponent(label);
setMainWindow(mainWindow);

the address is http://localhost:8080/miproyecto/ and it works ok

If I add

Label label = new Label(“Hello Vaadin user”);
Button btn = new Button(“What is the time?”);
mainWindow.addComponent(label);
mainWindow.addComponent(btn);
setMainWindow(mainWindow);

then the addres becomes
http://localhost:8080/miproyecto/WEB-INF/classes/com/example/miproyecto/MiproyectoApplication.java
and I get a resource not found from Tomcat.

I would like to know why is this appening and which is the correct path, the first one or the second.
I’ve tried to make a clean and nothing changes.

Thank you, cause I’m stucked at the beginning.

This is just Eclipse making guesses (based on what is selected) about what part of a (non-Vaadin) application you want to see when you do “debug on server”. The way it does it does not make sense in a Vaadin application.

The first path is ok.
You could set up the servlet mapping sections in your web.xml to make your application handle the extra paths of the path - and ignore them.

OK, I got it,

it depends on what you have selected in the project explorer to work or not,

Where must i put the resources to work ?

I mean , I don’t know where to put smiley.gif to use it lije this:


mainWindow.addComponent(new Embedded (“”,
new ClassResource(“smiley.gif”,
mainWindow.getApplication())));

I use TomCat, but I will probably switch to Jetty.

Thank you.
Serg…

Eclipse Indigo’s
Web Tools Platform
(WTP) offers two context menu items for cleaning out the Tomcat-related folders created in an invisible folder:
• Clean…
• Clean Tomcat Work Directory…

Context+click on a server listed in the Servers pane, as seen here in this screenshot:

By the way, the WTP’s invisible folder mentioned above has this location on my Mac:
/Users/your_user_name/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core

–Basil Bourque

I am desperate.
I have the same problem.
In a a windows computer was working and now in a Mac is not working.
Created a project from scratch, only the example and dont work…