I am getting an HTTP 500 error from server when i try to read the properties file in a JSF page. Reading Bundle from class file is working though.
Below is the structure of my Sample webapp which is an osgi bundle in Tomcat. The class path in manifest file is web/WEB-INF/classes. So the resource bundle is already present in the class path
Sample
META-INF ---> MANIFEST.MF
web
App
home.jsp
login.jsp
index.html
WEB-INF
web.xml
faces-config.xml
classes-->myresource.properties
lib------>packaged jar
Below is content of my home.jsp file which is present in Sample/web/App directory.
<f:loadBundle var="bundle" basename="com.obj.colours" />
<f:loadBundle var="addonpages" basename="CustomAddonPages" />
.
.
<h:outputText value='#{brandingBundle["label.ManagementConsole"]}' />
<!-- Custom Reporting -->
<!-- below part gives error and i have to use the above hard
coded way using anchor tag-->
<h:commandLink action="#{addonpages.Redirectpage}">
<h:outputText value="Custom Reporting"/>
</h:commandLink>
the properties file contain a single line
Redirectpage=../CustomReport.faces
The Error from the Server is as below
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.RuntimeException: javax.servlet.ServletException: #{addonpages.Redirectpage}: javax.faces.el.MethodNotFoundException: Redirectpage
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.serviceHelper(BundlePathAwareServiceHandler.java:254)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.service(BundlePathAwareServiceHandler.java:197)
com.businessobjects.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:220)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.businessobjects.pinger.TimeoutManagerFilter.doFilter(TimeoutManagerFilter.java:159)
root cause
javax.servlet.ServletException: #{addonpages.Redirectpage}: javax.faces.el.MethodNotFoundException: Redirectpage
javax.faces.webapp.FacesServlet.service(FacesServlet.java:225)
com.businessobjects.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:110)
com.businessobjects.http.servlet.internal.ServletLastFilterChainElement.service(ServletLastFilterChainElement.java:30)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:46)
com.businessobjects.webutil.boetrustguard.BOETrustValidateFilter.doFilter(BOETrustValidateFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.internal.filters.BrowserRenderingModeFilter.doFilter(BrowserRenderingModeFilter.java:20)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.boetrustguard.BOETrustPrepareFilter.doFilter(BOETrustPrepareFilter.java:32)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.shared.tracelog.TraceLogScopeFilter.doFilter(TraceLogScopeFilter.java:38)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.sdk.actionfilter.WorkflowFilter.doFilter(WorkflowFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.appcontext.RequestInitFilter.doFilter(RequestInitFilter.java:26)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.serviceHelper(BundlePathAwareServiceHandler.java:235)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.service(BundlePathAwareServiceHandler.java:197)
com.businessobjects.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:220)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.businessobjects.pinger.TimeoutManagerFilter.doFilter(TimeoutManagerFilter.java:159)
root cause
javax.faces.FacesException: #{addonpages.Redirectpage}: javax.faces.el.MethodNotFoundException: Redirectpage
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:94)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
com.businessobjects.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:110)
com.businessobjects.http.servlet.internal.ServletLastFilterChainElement.service(ServletLastFilterChainElement.java:30)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:46)
com.businessobjects.webutil.boetrustguard.BOETrustValidateFilter.doFilter(BOETrustValidateFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.internal.filters.BrowserRenderingModeFilter.doFilter(BrowserRenderingModeFilter.java:20)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.boetrustguard.BOETrustPrepareFilter.doFilter(BOETrustPrepareFilter.java:32)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.shared.tracelog.TraceLogScopeFilter.doFilter(TraceLogScopeFilter.java:38)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.sdk.actionfilter.WorkflowFilter.doFilter(WorkflowFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.appcontext.RequestInitFilter.doFilter(RequestInitFilter.java:26)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.serviceHelper(BundlePathAwareServiceHandler.java:235)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.service(BundlePathAwareServiceHandler.java:197)
com.businessobjects.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:220)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.businessobjects.pinger.TimeoutManagerFilter.doFilter(TimeoutManagerFilter.java:159)
root cause
javax.faces.el.MethodNotFoundException: Redirectpage
com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:219)
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:144)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
com.businessobjects.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:110)
com.businessobjects.http.servlet.internal.ServletLastFilterChainElement.service(ServletLastFilterChainElement.java:30)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:46)
com.businessobjects.webutil.boetrustguard.BOETrustValidateFilter.doFilter(BOETrustValidateFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.internal.filters.BrowserRenderingModeFilter.doFilter(BrowserRenderingModeFilter.java:20)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.webutil.boetrustguard.BOETrustPrepareFilter.doFilter(BOETrustPrepareFilter.java:32)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.shared.tracelog.TraceLogScopeFilter.doFilter(TraceLogScopeFilter.java:38)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.sdk.actionfilter.WorkflowFilter.doFilter(WorkflowFilter.java:45)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.swd.appcontext.RequestInitFilter.doFilter(RequestInitFilter.java:26)
com.businessobjects.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:72)
com.businessobjects.http.servlet.internal.filter.FilterChainImpl.doFilter(FilterChainImpl.java:43)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.serviceHelper(BundlePathAwareServiceHandler.java:235)
com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler.service(BundlePathAwareServiceHandler.java:197)
com.businessobjects.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:220)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.businessobjects.pinger.TimeoutManagerFilter.doFilter(TimeoutManagerFilter.java:159)
You get a MethodNotFoundException so the class is found but the method does not exist. Maybe the method must be public?
Solution
I am really sorry for committing a gross mistake at first place and then answering to my own question. May be you experts might have guessed it correctly had i shown you the entire page source.
It is not possible to use h:commandLink when NOT present inside the form element and i should have used h:outputLink
However when i had first modified the page and used a commandLink the error thrown was not as clear and as Balazs answered i have to make use of method expression for use inside the action attribute of a commandLink. And so i went ahead, creating a ResourceBundle class of my own and then read my .properties inside this resourcebundle, and still i faced the same issue.
The next thing i tried was instead of modifying the vendor provided webapp, i created one sample app in eclipse and tested over there. and this time, Eclipse was generous enough to display the page with the commandLink space showing the line -
commandLink can only be used when present inside form element
So now i am using the outputLink and loading the .properties file bundle and it works just fine.
Related
I am developing an application for FB Login with website using Javascript and JSF. I have posted my code at here. The problem is, when I run my application it does't show the JSF page, it instead throws the following exception:
Nov 28, 2013 7:21:46 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/FacebookLogin] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What is the problem here and how can I solve it?
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
As the package name hints, the mentioned class is part of JSTL. The exception is clearly telling that the class definition file of the mentioned class cannot be found in the runtime classpath. I.e. the Config.class file or at least the JAR file containing that class is missing in webapp's runtime classpath.
JSTL is normally already provided out the box by a full fledged Java EE container such as TomEE, JBoss AS/EAP/WildFly, Payara/GlassFish, WebLogic, etc but not by barebones JSP/Servlet containers such as Tomcat and Jetty. For them, you'd need to supply JSTL along with the web application yourself, exactly like as you'd do for JSF (which is also already provided out the box by full fledged Java EE containers).
You're facing this exception because Facelets has for its <c:xxx> tags a dependency on the JSTL implementation JAR file, while you're using Tomcat which doesn't ship with JSTL out the box. JSTL is as a separate library available in flavor of jstl-1.2.jar. Just download and drop it in your webapp's /WEB-INF/lib folder, along with the JSF JAR file(s) which you already placed there, and this exception should disappear. Maven users can achieve that by adding the below dependency (and performing a full rebuild/redeploy):
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
Alternatively, just replace Tomcat by a real Java EE container.
See also:
Our JSF wiki page - contains JSF installation instructions
I just want to add my contribute if someone gets this error trying to create a springframework-4.0.7-RELEASE module for jboss-eap-6.4.0.GA. My module.xml now contains:
<dependencies>
...
<!-- Contains javax.servlet.jsp.jstl.core.Config -->
<module name="javax.servlet.jstl.api"/>
...
</dependencies>
After a server failure, the plugin stopped working. I tried (to no avail) removing the folder from .unpacked directory and the .zip file, stopping TC, starting TC, upload plugin again, restart TC.
After that, when I attempt to add any of the plugin build runners is:
Unexpected Error This was not supposed to happen. Please provide the
error details to your TeamCity server maintainer. If you maintain this
TeamCity installation please report this error to JetBrains. Error
message: javax.servlet.jsp.JspException:
javax.servlet.jsp.JspException: javax.servlet.ServletException:
javax.servlet.ServletException: java.lang.ClassFormatError: Truncated
class file TeamCity: 8.1.2 (build 29993) Operating system: Linux
(3.11.10-11-default, amd64) Java: 1.7.0_55-b13 (Oracle Corporation)
Servlet container: Apache Tomcat/7.0.37 Trace:
javax.servlet.jsp.JspException: javax.servlet.jsp.JspException:
javax.servlet.jsp.JspException: javax.servlet.ServletException:
javax.servlet.ServletException: java.lang.ClassFormatError: Truncated
class file at
org.apache.jsp.tag.webp.container_tag$Helper.invoke(container_tag.java:365)
at
org.apache.jsp.tag.webchangeRequest_tag.doTag(webchangeRequest_tag.java:107)
at
org.apache.jsp.tag.webp.container_tag._jspx_meth_bs_005fchangeRequest_005f0(container_tag.java:240)
at org.apache.jsp.tag.webp.container_tag.doTag(container_tag.java:161)
at
org.apache.jsp.admin.editRunParams_jsp._jspService(editRunParams_jsp.java:209)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at
jetbrains.spring.web.TeamCityJSPServletImpl.access$001(TeamCityJSPServletImpl.java:7)
at
jetbrains.spring.web.TeamCityJSPServletImpl$1.apply(TeamCityJSPServletImpl.java:2)
at
jetbrains.buildServer.util.Util.doUnderContextClassLoader(Util.java:68)
at
jetbrains.spring.web.TeamCityJSPServletImpl.service(TeamCityJSPServletImpl.java:1)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at
jetbrains.spring.web.JspController.doHandle(JspController.java:0) at
jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:75)
at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at
... much more that cannot fit here
Try do add the plugin while TC is not running. Ie. almost same procedure as you described.
Shutdown TC
Remove all plugin related files
Start TC to normal operation
Shutdown TC completely
Add the zip file (make sure you dont have any "auto unpack" features and aswell, make sure about filesystem permissions (umask aso.)
Startup TC.
Any differences??
Could you please describe the "server failure" incident?
Kind regards
Ola Tenglin
Below is the stack trace of the error:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet spring threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:260)
org.springframework.core.convert.support.GenericConversionService.addConverter(GenericConversionService.java:83)
org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:63)
org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:54)
org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:43)
org.springframework.core.env.AbstractPropertyResolver.<init>(AbstractPropertyResolver.java:41)
org.springframework.core.env.PropertySourcesPropertyResolver.<init>(PropertySourcesPropertyResolver.java:41)
org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:98)
org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
org.springframework.web.context.support.StandardServletEnvironment.<init>(StandardServletEnvironment.java:44)
org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:213)
org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:203)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)
Being new to MVC architecture and spring...need help to resolve this!
java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
I imagine that you just deployed on a server where spring-core version jar is different than the one against which you compiled. Check the server spring-core.jar and very likely GenericTypeResolver.resolveTypeArguments has Method as first parameter and not Class hence your exception
I am trying to learn Spring web services, I found this tutorial :
http://jeromebulanadi.wordpress.com/2010/02/25/basic-spring-web-service-tutorial-from-contract-to-security/#comment-302
I imported the project prerson in eclipse, added the jar files, but when I run the project and typed :
http://localhost:8080/person/Person.wsdl
I got this error :
javax.servlet.ServletException: Servlet.init() for servlet spring-ws threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:662)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘Person’ defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
Can you please help me ?
thanks.
java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
Add xalan-2.7.1.jar to your CLASSPATH.
Use xalan-2.7.0.jar. It worked for me.
I found a solution to this problem, just added serializer.jar to my classpath and it's working now, it looks like xalan-2.7.1.jar is missing TreeWalker.
I am trying to implement ajax to my struts2 application using the DWR .
while configuring DWR i need to make the theme of the form as ajax .
I am using struts2-core2.1.6.jar in which it did not have the ajax theme at all , the template folder has the css_xhtml,simple,xhtml and archive themes
I have made all the congfigurations for the DWR except making the theme as ajax to the Form . if i make the theme as ajax to the Form then i am getting the following exception
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
root cause
org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
root cause
Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.struts2.components.UIBean.end(UIBean.java:515)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005ftextfield_005f0(contactcontent_jsp.java:421)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005fform_005f0(contactcontent_jsp.java:326)
org.apache.jsp.contactus.contactcontent_jsp._jspService(contactcontent_jsp.java:157)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
root cause
java.io.FileNotFoundException: Template /template/ajax/text.ftl not found.
freemarker.template.Configuration.getTemplate(Configuration.java:489)
freemarker.template.Configuration.getTemplate(Configuration.java:452)
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
org.apache.struts2.components.UIBean.end(UIBean.java:513)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005ftextfield_005f0(contactcontent_jsp.java:421)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005fform_005f0(contactcontent_jsp.java:326)
org.apache.jsp.contactus.contactcontent_jsp._jspService(contactcontent_jsp.java:157)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
Apache Tomcat/6.0.26
how do i solve this ?
As you said ajax is moved out from struts 2 bundle. If you want to use it you have to have "struts2-dojo-plugin-2.2.1.1.jar" in WEB-INF/lib folder and in the jsp you need to include these tags.
<%# taglib prefix="sx" uri="/struts-dojo-tags" %>
<sx:head/>
You can create in struts your own theme. Just add/modify the .ftl files in the right folder. For a netbeans project create WEB-INF/classes/template/foo and put the templates you need in there.
For detailed information read the last part of Integrate struts2 into netbeans