Quantcast
Channel: The Object Oriented Life
Viewing all articles
Browse latest Browse all 37

Upgrading Tapestry version from 5.0.18 to 5.2.5: Issues and Resolutions

$
0
0

In this post I am going to write about the issues that we have faced during the up-gradation of the tapestry version from 5.0.18 to 5.2.5 in one our projects. Below are some of them. Hope this collection will help someone!


1. Changes in the RequestPathOptimizer file inside tapestry.


Issue Logs:-


Caused by: java.lang.ClassNotFoundException: org.apache.tapestry5.internal.services.RequestPathOptimizer from BaseClassLoader@41c491{VFSClassLoaderPolicy@1d02b85{name=vfsfile:/D:/SVN/trunk/export/tools/jboss-5.0.1.GA/server/default/deploy/ROOT.war/ .......
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:422)


Solution:-


Remove all the tapestry-spring dependancies to resolve this issue.


Reference:-


Tapestry JIRA 
Mailing list URL 




2.Including the tapestry bean validator jar.


Logs:-


Caused by: java.lang.ClassNotFoundException: javax.validation.ValidatorFactory from ......
..............
real=file:/D:/SVN/trunk/export/tools/jboss-5.0.1.GA/server/default/deploy/ROOT.war/WEB-INF/lib/XmlSchema-1.4.2.jar]] delegates=null exported=[]}} at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:422)


Solution:-


There is new feature in Tapestry called bean validator that needs the validation api and implementation jars to be added it can be downloaded from the project homepage here.


3.Changes in the tapestry spring integration.


Logs:-


Caused by: java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:179)
at org.apache.tapestry5.internal.spring.SpringModuleDef$3$1.invoke(SpringModuleDef.java:194)
at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
... 91 more
java.lang.RuntimeException: Exception constructing service 'ApplicationContext': Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!


Solution:-


From Tapestry 5.2.x it will load the spring context automatically and hence we need to remove the below from web.xml. This will help in live class loading of service class. Also the spring beans should be wired and not to be injected as services.As per this there will be changes in All the Page classes and web.xml


Reference:-


Mailing list URL
Tapestry Wiki-1 
Tapestry Wiki-2


As per the article "The changes below represent an unfortunate backwards compatibility issue. If necessary, you can still use tapestry-spring version 5.0.18 with the rest of Tapestry."


If we want to continue using spring-tapestry 5.2.5 jar we have to make changes in each and every Page file where spring services are injected. Also the spring beans should be wired and not to be injected as services.




4. Using Tapestry 5.2.5 inside the JBoss Application server.


Logs:-


Caused by: java.io.IOException
at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.getFile(DefaultVFSRegistry.java:125)
at org.jboss.virtual.protocol.AbstractVFSHandler.openConnection(AbstractVFSHandler.java:71)
at java.net.URL.openConnection(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl.scanDirStream(ClassNameLocatorImpl.java:182)
at org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl.scanURL(ClassNameLocatorImpl.java:131)
at org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl.findClassesWithinPath(ClassNameLocatorImpl.java:96)
at org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl.locateClassNames(ClassNameLocatorImpl.java:75)
... 85 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 159: vfszip:/D:/SVN/trunk/export/tools/jboss-5.0.1.GA/server/default/deploy/ROOT.war/WEB-INF/lib/tapestry-upload-5.2.5.jar/org/apache/tapestry5/upload/components/PK/
at java.net.URI$Parser.fail(Unknown Source)


Solution:-


As per the below links we need to use a patch to fix it.


Mailing list URL-1
Mailing list URL-2 
Tapestry JIRA
Tapestry Wiki



5. Changes in the Locale implementation


If you use the url to load pages and your application supports the multiple languages then you need to append the locale code infront of the url.


For example:
Current url: "http://localhost/superpopup" should be changed to "http://localhost/${localeInd}/superpopup" 


Mailing List URL 


6. Tapestry handling of transients instances ValueEncoder


Mailing List URL


7. Change in the way @Secure is handled in the page classes.


Most of the applications we will have the Index page tagged with the @Secure annotation to force the usage of https protocol. Some how I could not get this done with the existing settings. To have this you need to add the below lines.


configuration.add(SymbolConstants.SECURE_ENABLED, "true");


Mailing List URL



Viewing all articles
Browse latest Browse all 37

Trending Articles