Ich versuche, eine einfache .XHTML-Seite in Java EE mit Tomcat 6 zum laufen zu bringen, allerdings ohne Erfolg. Sobald der Tomcat hochgefahren ist, springt die Prozessorauslastung von Java.exe auf 100%, und es passiert nichts. in Eclipse Indigo öffnet sich ein Browserfenster, das ewig lädt - benutzt man hier den eingebauten Eclipse-Browser, stürzt Eclipse ab. Netbeans kommt gar nicht zum Öffnen eines Browser-Fensters. Ich habe es auf mehreren Computern und Betriebssystemen ausprobiert, ohne Erfolg.
Ich habe mittlerweile sämtlichen Code aus der index.xhtml entfernt, um auszuschließen, dass dur eigenen Code eine Endlosschleife ausgelöst wird - aber selbst der Versuch, eine leere XHTML-Seite wie unten anzuzeigen, führt zum endlosen Laden und Absturz.
index.xhtml:
[xml]<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Semester</title>
</h:head>
<h:body>
</h:body>
</html>[/xml]
web.xml: (auch hier wurde mittlerweile eine ganze stange Code auskommentiert, die bei Beispielen, die ich im Internet gefunden hab, nicht nötig waren, um diese Programme zum Laufen zu bringen)
[xml]<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>App-Name</display-name>
<filter>
<filter-name>CayenneFilter</filter-name>
<filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CayenneFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- <listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener> -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<!-- <context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<description>
This parameter tells MyFaces if javascript code should be allowed in
the rendered HTML output.
If javascript is allowed, command_link anchors will have javascript code
that submits the corresponding form.
If javascript is not allowed, the state saving info and nested parameters
will be added as url parameters.
Default is 'true'</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
If true, rendered HTML code will be formatted, so that it is 'human-readable'
i.e. additional line separators and whitespace will be written, that do not
influence the HTML code.
Default is 'true'</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>
If true, a javascript function will be rendered that is able to restore the
former vertical scroll on every request. Convenient feature if you have pages
with long lists and you do not want the browser page to always jump to the top
if you trigger a link or button action that stays on the same page.
Default is 'false'
</description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param> -->
</web-app>[/xml]
faces-config.xml:
[xml]<?xml version="1.0"?>
<faces-config 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-facesconfig_2_0.xsd"
version="2.0">
<!-- Empty for now. Your entries will go here. But even
if you have no entries in faces-config.xml, you are required
to have a valid faces-config.xml file with legal
start and end tags.
From JSF 2.0 tutorial at JSF 2.0 Tutorial (JavaServer Faces 2 Tutorial) -->
</faces-config>
[/xml]
Der Tomcat startet ordnungsgemäß:
Im Projekt vorhandene Bean-Klassen u.a. sind ohne Fehler, die ein neues Kompilieren verhindern würden.
Ich benutze:
- NetBeans IDE 7.0 bzw. Eclipse Indigo
- Apache Tomcat 6.0.32 (! ich habe nicht die Möglichkeit, auf Tomcat 7 umzusteigen)
- JDK 1.6
Ich habe mittlerweile sämtlichen Code aus der index.xhtml entfernt, um auszuschließen, dass dur eigenen Code eine Endlosschleife ausgelöst wird - aber selbst der Versuch, eine leere XHTML-Seite wie unten anzuzeigen, führt zum endlosen Laden und Absturz.
index.xhtml:
[xml]<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Semester</title>
</h:head>
<h:body>
</h:body>
</html>[/xml]
web.xml: (auch hier wurde mittlerweile eine ganze stange Code auskommentiert, die bei Beispielen, die ich im Internet gefunden hab, nicht nötig waren, um diese Programme zum Laufen zu bringen)
[xml]<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>App-Name</display-name>
<filter>
<filter-name>CayenneFilter</filter-name>
<filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CayenneFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- <listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener> -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<!-- <context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<description>
This parameter tells MyFaces if javascript code should be allowed in
the rendered HTML output.
If javascript is allowed, command_link anchors will have javascript code
that submits the corresponding form.
If javascript is not allowed, the state saving info and nested parameters
will be added as url parameters.
Default is 'true'</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
If true, rendered HTML code will be formatted, so that it is 'human-readable'
i.e. additional line separators and whitespace will be written, that do not
influence the HTML code.
Default is 'true'</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>
If true, a javascript function will be rendered that is able to restore the
former vertical scroll on every request. Convenient feature if you have pages
with long lists and you do not want the browser page to always jump to the top
if you trigger a link or button action that stays on the same page.
Default is 'false'
</description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param> -->
</web-app>[/xml]
faces-config.xml:
[xml]<?xml version="1.0"?>
<faces-config 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-facesconfig_2_0.xsd"
version="2.0">
<!-- Empty for now. Your entries will go here. But even
if you have no entries in faces-config.xml, you are required
to have a valid faces-config.xml file with legal
start and end tags.
From JSF 2.0 tutorial at JSF 2.0 Tutorial (JavaServer Faces 2 Tutorial) -->
</faces-config>
[/xml]
Der Tomcat startet ordnungsgemäß:
Using CATALINA_BASE: "E:\Tomcat\apache-tomcat-6.0.32"
Using CATALINA_HOME: "E:\Tomcat\apache-tomcat-6.0.32"
Using CATALINA_TMPDIR: "E:\Tomcat\apache-tomcat-6.0.32\temp"
Using JRE_HOME: "C:\Programme\Java\jdk1.6.0_26"
Using CLASSPATH: "E:\Tomcat\apache-tomcat-6.0.32\bin\bootstrap.jar"
02.07.2011 15:27:29 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: ****
02.07.2011 15:27:36 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
02.07.2011 15:27:36 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 11159 ms
02.07.2011 15:27:36 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
02.07.2011 15:27:36 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
02.07.2011 15:27:36 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
02.07.2011 15:27:40 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
02.07.2011 15:27:40 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON' found, using default value false
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS' found, using default value false
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE' found, using default value false
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS' found, using default value true
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE' found, using default value false
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getLongInitParameter
INFO: No context init parameter 'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.VIEWSTATE_JAVASCRIPT' found, using default value false
02.07.2011 15:27:46 org.apache.myfaces.shared_impl.config.MyfacesConfig getStringInitParameter
INFO: No context init parameter 'org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS' found, using default value auto
02.07.2011 15:27:47 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE' found, using default value false
02.07.2011 15:27:47 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.VALIDATE_XML' found, using default value false
02.07.2011 15:27:47 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG' found, using default value true
02.07.2011 15:27:47 org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
02.07.2011 15:27:48 org.apache.myfaces.config.DefaultFacesConfigurationProvider getStandardFacesConfig
INFO: Reading standard config META-INF/standard-faces-config.xml
02.07.2011 15:27:49 org.apache.myfaces.config.DefaultFacesConfigurationProvider getWebAppFacesConfig
INFO: Reading config /WEB-INF/faces-config.xml
02.07.2011 15:27:51 org.apache.myfaces.config.annotation.DefaultAnnotationProvider webClasses
WARNUNG: AnnotationConfigurator does not found classes for annotations in /WEB-INF/classes/test-classes/ . This could happen because maven jetty plugin is used (goal jetty:run). Try configure org.apache.myfaces.annotation.SCAN_PACKAGES init parameter or use jetty:run-exploded instead.
02.07.2011 15:27:51 org.apache.myfaces.config.LogMetaInfUtils logArtifact
INFO: Artifact 'myfaces-bundle' was found in version '2.0.7' from path 'file:/E:/SoPro/eclipse/workspace/VeLP-System/nbbuild/web/WEB-INF/lib/myfaces-bundle-2.0.7.jar'
02.07.2011 15:27:52 org.apache.myfaces.util.ExternalSpecifications isBeanValidationAvailable
INFO: MyFaces Bean Validation support disabled
02.07.2011 15:27:53 org.apache.myfaces.application.ApplicationImpl getProjectStage
INFO: Couldn't discover the current project stage, using Production
02.07.2011 15:27:53 org.apache.myfaces.config.FacesConfigurator handleSerialFactory
INFO: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
02.07.2011 15:27:53 org.apache.myfaces.config.annotation.DefaultLifecycleProviderFactory getLifecycleProvider
INFO: Using LifecycleProvider org.apache.myfaces.config.annotation.TomcatAnnotationLifecycleProvider
02.07.2011 15:27:54 org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
INFO: ServletContext 'E:\SoPro\eclipse\workspace\VeLP-System\nbbuild\web\' initialized.
02.07.2011 15:27:55 org.apache.cayenne.conf.RuntimeLoadDelegate startedLoading
INFO: started configuration loading.
02.07.2011 15:27:55 org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataDomain
INFO: loaded domain: <*****>
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate loadDataMap
INFO: loaded <map name=' <*****>' location=' <*****>.map.xml'>.
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: loading <node name=' <*****>' datasource=' <*****>.driver.xml' factory='org.apache.cayenne.conf.DriverDataSourceFactory' schema-update-strategy='org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy'>.
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
02.07.2011 15:27:57 org.apache.cayenne.conf.DriverDataSourceFactory load
INFO: loading driver information from ' <*****>.driver.xml'.
02.07.2011 15:27:57 org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
INFO: loading driver org.gjt.mm.mysql.Driver
02.07.2011 15:27:57 org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
INFO: loading user name and password.
02.07.2011 15:27:57 org.apache.cayenne.access.QueryLogger logPoolCreated
INFO: Created connection pool: <*****>
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: loaded datasource.
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate initAdapter
INFO: no adapter set, using automatic adapter.
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate shouldLinkDataMap
INFO: loaded map-ref: <*****>.
02.07.2011 15:27:57 org.apache.cayenne.conf.RuntimeLoadDelegate finishedLoading
INFO: finished configuration loading in 2484 ms.
02.07.2011 15:27:57 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
02.07.2011 15:27:58 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
02.07.2011 15:27:59 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
02.07.2011 15:27:59 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
02.07.2011 15:27:59 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/109 config=null
02.07.2011 15:27:59 org.apache.catalina.startup.Catalina start
INFO: Server startup in 23068 ms
Im Projekt vorhandene Bean-Klassen u.a. sind ohne Fehler, die ein neues Kompilieren verhindern würden.
Ich benutze:
- NetBeans IDE 7.0 bzw. Eclipse Indigo
- Apache Tomcat 6.0.32 (! ich habe nicht die Möglichkeit, auf Tomcat 7 umzusteigen)
- JDK 1.6
commons-beanutils-1.8.3.jar
commons-beanutils-1.8.3-sources.jar
commons-beanutils-bean-collections-1.8.3.jar
commons-beanutils-core-1.8.3.jar
commons-collections-3.2.1.jar
commons-collections-3.2.1-sources.jar
commons-digester-2.1.jar
commons-digester-2.1-sources.jar
commons-logging-1.1.1.jar
commons-logging-1.1.1-sources.jar
commons-logging-adapters-1.1.1jar
commons-logging-api-1.1.1.jar
ashwood-2.0.jar
cayenne-server-3.0.2.jar
vpp-2.2.1.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar
myfaces-bundle-2.0.7.jar
mysql-connector-java-5.1.16.jar
Zuletzt bearbeitet: