Richfaces Resource Optimization settings in RF 4.0.0-Final - optimization

I'm attempting to turn on resource optimization (packing) for my applicaiton using RF 4.0.0 running under JBoss 6.1.0
I know that the means to turn this on changed from RF 3.x to RF 4.x (https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-Upgrading)
The problem is neither the 3.x means or the 4.x means seem to work with the 4.0.0-Final version.
I'm also using skinning (blueSky) and have seen posts that indicate that packing doesn't work with a skinned application.
In my web.xml I've inserted both sets of configuration parameters, but the app refuses to pack and compress all of the RF .js and .css files
<context-param>
<param-name>org.richfaces.resourceOptimization.enabled</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>

I think I may have found the answer ... for RF 4.0.0.Final version there is no support for either set of optimization settings.
Here's a relevant post:
https://community.jboss.org/message/605001
To solve the problem I've upgraded to the latest (as of this date) 4.X version which is 4.3.4.
If someone can answer this to the contrary let me know.
As an aside, the only compatability issues I've found so far going from 4.0.0.Final to 4.3.4.Final are:
- I needed to add switchType="client" to some rich:accordian components that did not specify a switch type.
I still need to do more testing

Related

How to update Lagom to latest stable release version

I followed the following tutorial: https://www.lagomframework.com/documentation/1.4.x/java/GettingStartedMaven.html
Point 3 mentioned:
Enter the number that corresponds with
com.lightbend.lagom:maven-archetype-lagom-java (at time of writing,
the number 1, and the only one available). Maven prompts you for the
version.
The problem is that Maven did not prompt me for a version, and used 1.1.0-RC1 by default. This version builds properly, although there are also minor errors popping up in the standard out like the one here:
Point 4 mentions:
Enter the number corresponding with the version of Lagom you want to
use. We recommend using the current stable release).
Current stable release version is 1.4.6.
I've tried modifying my Maven pom.xml manually since I didn't receive the prompt and tried rebuilding:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lagom.version>1.4.6</lagom.version> <!-- Changed here -->
<play.version>2.5.4</play.version>
<conductr.lib.name>lagom10-conductr-bundle-lib_2.11</conductr.lib.name>
</properties>
But building with lagom:runAllresults in error:
1.4.6 should be a stable release. Are there dependencies that also require updates that I have to take care of when using this version?
Thanks!
Never mind, I followed the following tutorial and it works fine:
https://www.lagomframework.com/blog/introducing-maven-support.html

Allow more than 2 gb file upload in struts2

I am using Struts 2.1 in my project.
In struts.xml maxsize element in my project is as follows :
<constant name="struts.multipart.maxSize" value="2147483648" />
For the file upload process,
is it possible to supersede the normal 2 Gb file limit of Struts2 ?
You should migrate to the latest version of Struts2.
From 2.3.20 and above, a new MulitpartRequest implementation can be used to upload large files:
Alternate Libraries
The struts.multipart.parser used by the fileUpload interceptor to
handle HTTP POST requests, encoded using the MIME-type
multipart/form-data, can be changed out. Currently there are two
choices, jakarta and pell. The jakarta parser is a standard part of
the Struts 2 framework needing only its required libraries added to a
project. The pell parser uses Jason Pell's multipart parser instead of
the Commons-FileUpload library. The pell parser is a Struts 2 plugin,
for more details see:
http://cwiki.apache.org/S2PLUGINS/pell-multipart-plugin.html. There
was a third alternative, cos, but it was removed due to licensing
incompatibilities.
As from Struts version 2.3.18 a new implementation of MultiPartRequest
was added - JakartaStreamMultiPartRequest. It can be used to handle
large files, see WW-3025 for more details, but you can simple set
<constant name="struts.multipart.parser" value="jakarta-stream" />
> in struts.xml to start using it.

CompositeELResolver Null Pointer Exception

I've got a problem with "javax.el.CompositeELResolver" which is used by TomEE's "javaee-api-6.0-5.jar".
Version information and svn-repository here:
http://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-el_2.2_spec/1.0.2
Source of class CompositeELResolver here:
http://svn.apache.org/viewvc/geronimo/specs/tags/geronimo-el_2.2_spec-1.0.2/src/main/java/javax/el/CompositeELResolver.java?view=log
In the "invoke" method I get a null pointer exception because the for-loop iterates through the whole resolvers-array which has got fields with value "null". I suppose this is not avoidable because of the "add" method that doubles the array size if required but does not initialize any values. Shouldn't there be a check if the resolver is "null" in the "invoke" method before using it?
For comparison I ran my application with another javax.el implementation and it's working properly:
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
Am I wrong with my supposition?
I found a similar-sounding issue here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=50293
Is it possible that multi-threading causes my problem?
Solved.
TomEE uses version 1.0.2 of http://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-el_2.2_spec
The bug is fixed in version 1.0.4
Based on the fixed geronimo el spec 1.0.4 version it is easy to fix the javaee-api-6.0-5.jar package.
Just download the newest jar file from here http://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-el_2.2_spec/1.0.4
and change the javax.el package in javaee-api-6.0-5.jar with the files comes from geronimo el 2.2 spec 1.0.4 jar files
I did it using mc under linux browse the content and copy from one to another. And I tested and works perfect.
Of course you can do it with jar utils as well :-)
It was strange for me that this problem did not exist in 32 bit windows environment but only in 64 bit linux environment. Anyhow the fix solves the problem.
Hope that there will be a javaee-api-6.0-6.jar soon :-)

intellij11 error when redeploying static files to jetty

all.
I got exactly same scenario like this one - Jetty Maven Plugin is ignoring custom webdefault.xml
the only difference is that I try to deploy my app to local jetty8 inside intellij11 on windows 7
the error is
Error copying 'myproj\src\main\webapp\less\defaults.less' to 'myproj\target\myproj.war
\less\defaults.less'.: myproj\target\myproj.war\less\defaults.less
(The requested operation cannot be performed on a file with a user-mapped section open)
I updated the webdefault.xml and set useFileMappedBuffer to false and later again I added in my filter config in web.xml which should also override the default but nothing helps.
I start jetty with default etc/jetty-jmx.xml.
what am I missing?
finally I managed to solve the issue.
following this page http://wiki.eclipse.org/Jetty/Howto/Deal_with_Locked_Windows_Files, unfortunately this page is outdated and the only way to keep resources unlocked, that worked for me, is
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
note that package have changed to org.eclipse.jetty since 7th version. the other solutions seems to be broken as jetty doesnt recognize context ref or throws other exceptions.
hope that this will help someone.

weblogic hot deployment working for jsps but not for web-inf/classes

I am deploying an ear application in weblogic 10.3 in exploded format with fast swap enabled and in dev mode.
The ear file contains a web app also in exploded format. The changes made to the jsps in the web app are getting reloaded. But the classes under web-inf when changed are not reloaded.
The weblogic deployment configuration is given below.
weblogic-application.xml content in ear/META-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:classloader-structure>
<wls:classloader-structure>
<wls:module-ref>
<wls:module-uri>web.war</wls:module-uri>
</wls:module-ref>
</wls:classloader-structure>
</wls:classloader-structure>
application.xml content in ear/META-INF
<display-name>web-ear</display-name>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>/web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
weblogic.xml content in war/WEB-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:context-root>/web</wls:context-root>
<wls:session-descriptor>
<wls:cookie-max-age-secs>-1</wls:cookie-max-age-secs>
<wls:cookie-name>JSESSIONID_SQE_AAI</wls:cookie-name>
<wls:cookie-path>/</wls:cookie-path>
<wls:cookies-enabled>true</wls:cookies-enabled>
<wls:invalidation-interval-secs>120</wls:invalidation-interval-secs>
<wls:id-length>52</wls:id-length>
<wls:timeout-secs>7200</wls:timeout-secs>
<wls:url-rewriting-enabled>true</wls:url-rewriting-enabled>
<wls:persistent-store-type>memory</wls:persistent-store-type>
<wls:http-proxy-caching-of-cookies>false</wls:http-proxy-caching-of-cookies>
</wls:session-descriptor>
<wls:jsp-descriptor>
<wls:page-check-seconds>6</wls:page-check-seconds>
</wls:jsp-descriptor>
<wls:container-descriptor>
<wls:servlet-reload-check-secs>6</wls:servlet-reload-check-secs>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
Is the configuration done above right? Are there any config details I have missed to include here? What other settings or configurations should I check?
Any help would be very much appreciated thanks.
Even if you enable FastSwap in your application, the modules that are declared in the classloader-structure will not support FastSwap because they aren't loaded by the RedefiningClassLoader, but rather by the GenericClassLoader.
You can test this by printing the classloader of your classes under WEB-INF/classes and check if it's the com.bea.wls.redef.RedefiningClassLoader or not.
I struggled to make them work together, you can see more details here https://forums.oracle.com/forums/thread.jspa?threadID=2476484&tstart=60 but, unfortunately, no solution so far.
Regards.