我试图让我的OSGi WAB工作,但要么得到NoClassDefFoundError: javax/faces/context/FacesContextFactory
或FacesContexFactory was not configured properly
。
当我在javax.faces.jar
war
WEB-INF/lib
文件中不包含glassfish-web.xml
时,我收到了第一个错误,并让应用程序使用了glassfish附带的那个错误设置class-laoder以在javax.faces.jar
中使用委托。
正因为如此,我想,也许我应该在war
中加入FacesContexFactory was not configured properly
但我会收到web.xml
错误。
我一直在谷歌搜索,并没有找到任何有用的东西。有什么建议吗?
这是我的配置:
<?xml version="1.0" encoding="UTF-8"?>
<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>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<!-- Servlet Config -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- jsf mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>pages/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
:
glassfish-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/helloWorld</context-root>
<class-loader delegate="true"/>
</glassfish-web-app>
:
MANIFEST.MF
Manifest-Verion: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: HelloWorld
Bundle-Version: 0.1.0.SNAPSHOT
Bundle-Name: Simulation Vis
Import-Package: javax.servlet,
javax.servlet.http,
javax.ws.rs,
javax.ws.rs.core,
org.osgi.framework;version="1.3.0"
Bundle-ClassPath: .,
WEB-INF/classes,
WEB-INF/lib/primefaces-5.3.jar
Web-ContextPath: /helloWorld
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Activator: my.Activator
Require-Bundle: tests.service;bundle-version="0.1.0";visibility:=reexport
Bundle-Vendor: Foo Bar
:
String name="";
while(itr1.hasNext()){
Employee emp=(Employee)itr1.next();
name=emp.getEmpname();
desn=emp.getDesncode();
dept=emp.getDeptcode();
}
<input type="text" name="empname" value="<%=name%>" readonly="yes">