Why aren't Managed Beans uploaded to Tomcat?

I created a JSF 2 web application with facelets. Libraries for JSF, stored in tomcat / lib, for sharing it between multiple applications. I thought that it might be better to store the libraries in the WEB-INF / lib folder of the application so that the application is more independent of the server configurations.

Now when I run tomcat through eclipse, managed beans load and work. But when I run tomcat directly / autonomously, managed beans do not load automatically. I used

@ManagedBean
@SessionScoped / @RequestScoped

Annotations for declaring classes as managed beans.

Why is this? What can I do to fix this?

I am not using faces-config.xml yet.

Thanks in advance.

edited by:

Perhaps this helps to understand what is happening:

javax.el.PropertyNotFoundException: /Artikel.xhtml @12,108 value="#{artikelBackingBean.nameFilterPattern}": Target Unreachable, identifier 'artikelBackingBean' resolved to null
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:93)
    at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1008)
    at javax.faces.component.UIInput.validate(UIInput.java:934)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1189)
    at javax.faces.component.UIInput.processValidators(UIInput.java:691)
    at javax.faces.component.UIForm.processValidators(UIForm.java:243)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1180)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)
+5
4

jsf beans WEB-INF/classes, tomcat: isn't .

mvn tomcat: run-war, .

+3

, webapp JSF 1.x JSF 2.x. JSF 1.x @ManagedBean, , / faces-config.xml.

- JSF. JAR JAR - zip/rar MANIFEST.MF JSF. Tomcat/lib, JRE/lib/* Webapp/WEB-INF/lib.

+1

, maven-war-plugin

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>${plugin-war-version}</version>
            <configuration>
                <archive>
                    <addMavenDescriptor>false</addMavenDescriptor>
                </archive>
                <archiveClasses>true</archiveClasses>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>

false (false) .

: http://www.baselogic.com/blog/development/java-javaee-j2ee/propertynotfoundexception-target-unreachable-identifier-patientbean-resolved-to-null

0

META-INF/context.xml - run-war. Context.

0

All Articles