问题描述
跳过更新3
我想在Weblogic 10.3.2(11g)上启用Seam调试页面。所以,我做了以下几点:
I want to enable the Seam debug page on Weblogic 10.3.2 (11g). So, I have done the following:
我在我的ejb和web maven项目中都有jboss-seam和jboss-seam-debug jar作为依赖项(都是模块我的超级项目)我把这个上下文参数放在我的web.xml中:
I have the jboss-seam and jboss-seam-debug jars as dependency in both my ejb and web maven projects (both are modules of my superproject) I put this context parameter in my web.xml:
<context-param>
<param-name>org.jboss.seam.core.init.debug</param-name>
<param-value>true</param-value>
</context-param>
现在,当我点击我的应用程序的URL时,我得到了具有此异常的调试页面(完整邮件末尾的堆栈跟踪):
Now, when I hit the URL of my application, I get the debug page with this exception (full stacktrace at the end of the post):
从帖子中我看到它似乎与某个路径中的两个jboss-seam或jboss-seam-debug相关。我打开了我的耳朵文件,其中只有一个存在(在耳中),而战争本身在WEB-INF / lib中没有库。
From posts I read it seems that this is somehow related to two jars of jboss-seam or jboss-seam-debug being in the classpath. I opened my ear file and only one of each is present (in the ear) whereas the war itself has no libraries in the WEB-INF/lib.
我也有阅读使用components.xml初始化调试页面的另一种方法。我还尝试在WEB-INF中包含以下components.xml,但它也不起作用:
I have also read of another way to initialize debug page using the components.xml. I also tried to include the following components.xml in the WEB-INF, but it didn't work either:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.2.xsd
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.2.xsd">
<core:init debug="true"/>
</components>
有关如何正确启用调试页面的建议吗?
Any suggestions on what to do to enable the debug page correctly?
干杯!
完整的堆栈跟踪:
org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:163)
org.jboss.seam.contexts.PageContext.isBeforeInvokeApplicationPhase(PageContext.java:175)
org.jboss.seam.contexts.PageContext.getCurrentWritableMap(PageContext.java:91)
org.jboss.seam.contexts.PageContext.remove(PageContext.java:105)
org.jboss.seam.Component.newInstance(Component.java:2141)
org.jboss.seam.Component.getInstance(Component.java:2021)
org.jboss.seam.Component.getInstance(Component.java:2000)
org.jboss.seam.Component.getInstance(Component.java:1994)
org.jboss.seam.Component.getInstance(Component.java:1967)
org.jboss.seam.Component.getInstance(Component.java:1962)
org.jboss.seam.faces.FacesPage.instance(FacesPage.java:92)
org.jboss.seam.core.ConversationPropagation.restorePageContextConversationId(ConversationPropagation.java:84)
org.jboss.seam.core.ConversationPropagation.restoreConversationId(ConversationPropagation.java:57)
org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:391)
org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
更新1:
现在调试页面根本没有出现。当我要求时,我得到一个页面:
Now the debug page does not appear at all. When I ask for http://localhost/myapp/debug.xhtml I get a page with:
myapp / debug.xhtml
myapp/debug.xhtml
与任何不存在的页面相同。我打开了.ear,下面的jboss罐子在:
the same as any page that does not exist. I opened the .ear and the following jboss jars are in:
- jboss-seam-debug-2.2.0.GA.jar
- jboss-el-1.0_02.CR4.jar
- jboss-seam-2.2.0.GA.jar
我当前的配置:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_2_5.xsd"
version="2.5">
<display-name>PRS 6.0</display-name>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!--
The default behavior of JSF is to map the incoming request for a JSF
view identifier (view ID for short) to a JSP file with the file
extension .jsp. To get JSF to look for a Facelets template instead, we
must register the .xhtml extension as the default suffix for JSF views
-->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/faces-config/application.xml
</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
<param-value>NONE</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<!-- Seam Filter -->
<!-- (MUST BE FIRST)-->
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- RichFaces filter -->
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<description>Set the size limit for uploaded files as attachments in bytes. (max 5MB)</description>
<param-name>maxRequestSize</param-name>
<param-value>5242880</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<listener>
<listener-class>
XX.XXXX.XXX.prs.web.listeners.ResourceInitializationListener</listener-class>
</listener>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<listener>
<listener-class>XX.XXXX.XXX.prs.web.listeners.EJBInjectionListener</listener-class>
</listener>
<!-- Seam Listener-->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<!-- Faces Servlet -->
<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>
</servlet-mapping>
- >
Seam资源Servlet< / servlet-name> - >
org.jboss.seam.servlet.SeamResourceServlet< / servlet-class> - >
- >
- >
Seam Resource Servlet< / servlet-name> - >
/ seam / resource / *< / url-pattern> - >
- >
-->Seam Resource Servlet</servlet-name>-->org.jboss.seam.servlet.SeamResourceServlet</servlet-class>-->-->-->Seam Resource Servlet</servlet-name>-->/seam/resource/*</url-pattern>-->-->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
faces.config
faces.config
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-facesconfig_1_2.xsd"
version="1.2">
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<el-resolver>org.jboss.seam.el.SeamELResolver</el-resolver>
<resource-bundle>
<base-name>XX.XXXX.XXX.prs.web.messages.messages</base-name>
<var>msgs</var>
</resource-bundle>
<resource-bundle>
<base-name>XX.XXXX.XXX.prs.web.messages.validation</base-name>
<var>val</var>
</resource-bundle>
</application>
<lifecycle>
<phase-listener>XX.XXXX.XXX.prs.web.listeners.SetFocusListener</phase-listener>
</lifecycle>
<!-- <lifecycle>-->
<!--
<phase-listener>XX.XXXX.XXX.prs.web.listeners.DebugPhaseListener</phase-listener>
-->
<converter>
<converter-for-class>XX.XXXX.XXX.prs.model.Applicant</converter-for-class>
<converter-class>
XX.XXXX.XXX.prs.web.common.converters.ApplicantConverter</converter-class>
</converter>
<validator>
<validator-id>EmailValidator</validator-id>
<validator-class>XX.XXXX.XXX.prs.web.common.validators.EmailValidator</validator-class>
</validator>
</faces-config>
components.xml
components.xml
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.2.xsd
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.2.xsd">
<core:init debug="true" />
<core:manager concurrent-request-timeout="500"
conversation-timeout="1200000" conversation-id-parameter="cid"
parent-conversation-id-parameter="pid" />
更新2:
这些人有同样的问题。它们有一个包含内部WAR项目的外部EAR项目。他们讨论这可能与罐子在项目中的结果有关。
These guys here have the same problem. They have an outer EAR project containing the inner WAR project. They discuss that this may be related to how jars end up in the projects.
我使用Maven,我设置它来创建Skinny Wars,即排除来自内部WAR项目的所有jar依赖项,因此它的大小仍然很小。它的所有依赖项都包含在EAR中,并被所有其他模块使用。
I use Maven, and I had set it to create "Skinny Wars", that is excluding all jar dependencies from the inner WAR project, so that it remains small in size. All its dependencies are contained in the EAR and are used by all other modules.
我改变了maven-war-plugin的设置,以便在战争中留下网络 - 特定的罐子(在链接中提到的那些,如RichFaces,jboss-seam-debug,Facelets等)。
I changed the settings of the maven-war-plugin to leave inside the war the web-specific jars (the ones mentioned in the link, like RichFaces, jboss-seam-debug, Facelets etc).
但问题已恢复到之前的形式。我现在得到调试页面,无论我按哪个链接,都有初始异常。
However, the problem has reverted to its previous form. I now get the debug page, whatever link I press, with the initial exception.
更新3:
应用程序.ear的结构如下:
UPDATE 3:The structure of the application .ear is the following:
application.ear
|--> APP-INF
| |--> classes
|--> lib (all jar dependencies go here, including the WAR dependencies, EJB module dependencies)
|-->META_INF
| |--> application.xml
| |--> data-sources.xml
| |--> MANIFEST.MF
| |--> weblogic.xml
| |--> weblogic-application.xml
|--> jboss-seam-2.2.0.GA.jar
|--> myEjbModule1.jar
|--> myEjbModule2.jar
|--> myEjbModule3.jar
|--> myEjbModule4.jar
|--> myWar.war (NO libraries in WEB-INF/lib, finds everything in EAR/lib)
部署.ear应用程序未启用调试(不包括耳中的jboss-seam-debug.jar),正确加载应用程序。
When deploying .ear application WITHOUT debug enabled (not including the jboss-seam-debug.jar in the ear), the application is loaded correctly.
部署WITH jboss-seam时在EAR(EAR / lib目录)中的-debug.jar,应用程序没有出现,但只有调试页面出现以下异常(最后是栈跟踪):
When deploying WITH jboss-seam-debug.jar in the EAR (EAR/lib directory), the application does not appear, but ONLY the debug page with the following exception (stacktrace at the end):
请求处理期间出现异常:
Exception during request processing:
当JBoss-izing相同的EAR(删除由JBoss提供的hibernate jar,并将所有库从EAR / lib移动到EAR根目录)时,应用程序正确加载。应用程序和调试页面正确显示。
When "JBoss-izing" the same EAR (remove hibernate jars, which are provided by JBoss, and move all libraries from EAR/lib to EAR root), the application loads correctly. BOTH the application AND the debug page appear correctly.
完整的堆栈跟踪:
推荐答案
Seam调试页面没有出现的原因令人难以置信(对我而言)。
The reason Seam the debug page did not appear is unbelievable (for me).
我用Apache Maven打包我的应用程序。传统上,maven管理的jar文件的文件名也包含版本号。 Seam的罐子是jboss-seam -2.2.0.GA .jar。因为Seam是应用程序中的EJB模块,所以我声明了它的依赖关系。实际上,EAR将其作为EJB模块(位于EAR的根目录中)包含在内,并在META-INF / application.xml中声明它。
I packaged my application with Apache Maven. Traditionally, the filenames of jar files managed by maven also contain the version number. The jar for Seam is jboss-seam -2.2.0.GA.jar. Because Seam is an EJB module in the application, I declared its dependency as such. And indeed, the EAR contained it as an EJB module (located in the root of the EAR) and also declared it in the META-INF/application.xml.
我不知道规范是否定义了EAR中EJB模块的命名限制,但文件名的版本部分是WebLogic不喜欢的(如果修改) ,战争在JBoss上运行正常。)
I don't know if the specification defines naming restrictions for the EJB modules in an EAR, but the version part of the filename was what WebLogic did not like (if modified, the war works fine on JBoss).
我改变了maven-ear-plugin中的设置:
I changed the setting in the maven-ear-plugin from this:
<ejbModule>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
</ejbModule>
到此:
<ejbModule>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<bundleFileName>jboss-seam.jar</bundleFileName>
</ejbModule>
现在我可以看到我的应用程序和调试页面。
And now I can see BOTH my application AND the Debug page.
这篇关于Jboss Seam:在WebLogic 10.3.2上启用调试页面(11g)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!