I use JSF 2.1.21 and Tomahawk 1.1.14. And when I try to deploy my project on a server(it can be Tomcat or Weblogic) I see the Warnings:
WARNING: JSF1029: Application is versioned at 2.0 (either explicitly by the version
of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class
'org.apache.myfaces.custom.aliasbean.AliasBeanTagHandler' depends on legacy facelet class.
The facelet artifact represented by this class will not be registered.
And many other warnings about diferent handlers (like a AliasBeansScopeTagHandler, HtmlInputCalendarTagHandler and so on). How can I avoid this warnings?
I tried to change the artifactId of tomahawk on tomahawk21 or tomahawk20, but it didn't help + it threw this:
java.util.MissingResourceException: Can't find bundle for base name resources.application, locale en
UPDATE:
I considered to add the stacktrace, which was displayed in the case where I tried to use tomahawk20:
java.util.MissingResourceException: Can't find bundle for base name resources.application, locale en
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:1028)
at org.apache.myfaces.tomahawk.resource.UncompressedResourceHandlerWrapper.getLocalePrefixForLocateResource(UncompressedResourceHandlerWrapper.java:242)
at org.apache.myfaces.tomahawk.resource.UncompressedResourceHandlerWrapper.createResource(UncompressedResourceHandlerWrapper.java:78)
at org.apache.myfaces.tomahawk.resource.UncompressedResourceHandlerWrapper.createResource(UncompressedResourceHandlerWrapper.java:61)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagLibrary.getCompositeComponentResource(CompositeComponentTagLibrary.java:155)
Before deploy your application on weblogic, the first deploy in under apache tomcat, and try to solve warnings.
" Can't find bundle for base name resources.application, locale en ", if your application wit maven, put
i18n.properties file to src\main\resources
I uploaded fully configured JSF2.2 project tamplate to github
JSF frontend
Related
I used the <f:websocket/> tag in my project with mojarra 2.3.3 and in project stage 'Development' everything was working fine. But when the project was deployed on our QA system with project stage 'Staging', the client produced the JS error "'mojarra' not defined".
This is due to the jsf.js being loaded as a blank file. When I debugged, I found that in com.sun.faces.application.resource.ResourceHelper#getInputStreamFromClientInfo the content of the js file is copied to a GZIPOutputStream which is never finished and thus nothing is written to the wrapped ByteArrayOutputStream (ll. 234-237), resulting in the empty response to my client.
In stage Development the file is delivered uncompressed.
Is this a bug or am I missing something? Is there a configuration for this? Is there a workaround?
I tried setting com.sun.faces.compressJavaScript to false with no luck.
When I call GZIPOutputStream#finish() on the stream before it's written to the ByteArrayInputStream in the debugger, the content of the input stream is correct and sent to the client. I also checked mojarra 2.3.8 but the code seems to be unchanged.
I expect the client to receive the correct js code. It doesn't necessarily have to be compressed.
Addition:
The project is running on a Tomcat 8.5.14 with JDK1.8.0_161 and I'm using Primefaces (6.2).
I created a miminal working example here which doesn't use Primefaces. It doesn't actually push anything into the websocket channel but the relevant thing here is the JS error when the index.xhtml is loaded.
It's also tested with Java 1.8_202, Tomcat 8.5.37, Mojarra 2.3.8. It's working (loading the jsf.js that is) with Mojarra 2.2.14.
I'm developing a web application with ActiveWeb. I wanted to change the package from app.controller to be.coudron.graphplanner.controller
I created a file activewebproperties and placed it in src/main/resources
the contents of the file are:
freeMarkerConfig=be.coudron.graphplanner.config.FreeMarkerConfig
bootstrap=be.coudron.graphplanner.config.AppBootstrap
dbconfig=be.coudron.graphplanner.config.DbConfig
route_config=be.coudron.graphplanner.config.RouteConfig
controllerConfig=be.coudron.graphplanner.config.AppControllerConfig
rootPackage=be.coudron.graphplanner
When I start the app with mvn jetty:run
I get the error:
org.javalite.activeweb.ControllerException: controller must be
in the 'app.controllers' package
What am i doing wrong?
There are no typos in the code nor the package names.
the exception message is self-explanatory: "controller must be in the 'app.controllers' package"
The file activeweb.properties is part of the framework and not editable. With time, you will appreciate simplicity and consistency of the framework. It requires that controllers are placed into app.controllers package. Please, refer to http://javalite.io/structure_of_activeweb_project#location-of-controllers
When deploying a dynamic web project with JSF facet to Eclipse+GlassFish, the following error occurs:
The message says:
WELD-001437: Normal scoped bean class javax.faces.component.UIViewRoot is not proxyable because the type is final or it contains a final method public final void javax.faces.component.UIComponent.popComponentFromEL(javax.faces.context.FacesContext) - com.sun.faces.cdi.ViewProducer#1ccfebd3
How is this caused and how can I solve it? The same codebase and server works fine in Netbeans.
Because your NetBeans project has been worked successful. In this case, You should import exist NetBeans project to Eclipse IDE, don't create new Eclipse project. This make avoid errors or mistakes.
Turn off all other web application servers, avoid port number collision.
I am running a "Hello World " struts 2 example.I have put all the required dependencies in the "/WEB-INF/lib" location. I have the following jars in my lib location :
commons.io_2.0.1.jar
commons-collections-3.2.1.jar
commons-fileupload-1.2.2.jar
commons-logging-1.1.1.jar
freemarker-2.3.16.jar
ognl-2.6.11.jar
struts2-core-2.2.3.jar
xwork-2.0.4.jar
Do I need any other jar file to run simple Struts2 app?
I am getting "HTTP Status 404 - requested resource is not available" exception when I am running my app.
Check the web.xml as well as the deployment descriptor created by Eclipse to know if it points to the correct JSP. i.e. if the jsp is under JSP folder, the welcome file should be /JSP/welcome.jsp
FYI: Filter dispatcher has been deprecated in struts2 i must suggest you to use
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
its always better to start with updated one
And try adding commons-lang3-3.x file. It might work.
I want override the following properties in my portal-ext.properties:
sites.email.membership.reply.subject=com/liferay/portlet/sites/dependencies/email_membership_reply_subject.tmpl
sites.email.membership.reply.body=com/liferay/portlet/sites/dependencies/email_membership_reply_body.tmpl
sites.email.membership.request.subject=com/liferay/portlet/sites/dependencies/email_membership_request_subject.tmpl
sites.email.membership.request.body=com/liferay/portlet/sites/dependencies/email_membership_request_body.tmpl
to something like this:
sites.email.membership.reply.subject=com/krishna/email_membership_reply_subject.tmpl
sites.email.membership.reply.body=com/krishna/email_membership_reply_body.tmpl
sites.email.membership.request.subject=com/krishna/email_membership_request_subject.tmpl
sites.email.membership.request.body=com/krishna/email_membership_request_body.tmpl
I have done this in EXT, i.e. I have created the package: ext-impl/src/com/krishna/ in EXT-plugin and it works fine, but I am not able to do this in a hook or portlet. Why? Because its giving me exception:
java.io.IOException: Unable to open resource in class loader com/krishna/email_membership_request_subject.tmpl
So, my question: Is there a way to do it in hook or portlet or only EXT can be used?
Thanks
This can be done only in an EXT plugin. Because of the following two reasons:
Hooks can be advantageous to override few properties/services but not all. This particular property is not supported by hooks.
This is definitely not possible with portlets, as you already are facing class loading issues. As portal-impl.jar is located inside the ROOT/WEB-INF/lib of liferay and your portlet doesn't have access to it.
So EXT plugin is the only way.