Thanks a lot it works very well with JBoss 5.1.

But my question is why having choose to use a class for configuring the 
application instead a simple XML file ?

Regards,
Mondes_engloutis.





________________________________
De : Geoff Callender <geoff.callender.jumpst...@gmail.com>
À : Tapestry users <users@tapestry.apache.org>
Envoyé le : Mar 16 mars 2010, 13 h 10 min 27 s
Objet : Re: Run Tapestry 5.1 with JBoss 5.1

This gets Tapestry working with JBoss 5.0.1...

In AppModule...

    // Tell Tapestry how to handle classpath URLs - we provide a converter to 
handle JBoss 5.
    // See http://wiki.apache.org/tapestry/HowToRunTapestry5OnJBoss5 .

    @SuppressWarnings("unchecked")
    public static void contributeServiceOverride(MappedConfiguration<Class, 
Object> configuration) {
        configuration.add(ClasspathURLConverter.class, new 
ClasspathURLConverterJBoss5());
    }

And the class is...

package au.com.tenam.web.services;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;

import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ClasspathURLConverterJBoss5 implements ClasspathURLConverter {
    private static Logger _logger = 
LoggerFactory.getLogger(ClasspathURLConverterJBoss5.class);

    public URL convert(URL url) {
        if (url != null && url.getProtocol().startsWith("vfs")) {
            // supports virtual filesystem used by JBoss 5.x
            try {
                URLConnection connection = url.openConnection();
                Object virtualFile = invokerGetter(connection, "getContent");
                Object zipEntryHandler = invokerGetter(virtualFile, 
"getHandler");
                Object realUrl = invokerGetter(zipEntryHandler, "getRealURL");
                return (URL) realUrl;
            }
            catch (Exception e) {
                _logger.info(e.getCause().toString());
            }
        }
        return url;
    }

    private Object invokerGetter(Object target, String getter) throws 
NoSuchMethodException, InvocationTargetException,
            IllegalAccessException {
        Class<?> type = target.getClass();
        Method method;
        try {
            method = type.getMethod(getter);
        }
        catch (NoSuchMethodException e) {
            method = type.getDeclaredMethod(getter);
            method.setAccessible(true);
        }
        return method.invoke(target);
    }

}


You can see it works fine in the JumpStart demo, which is running on JBoss 
5.0.1. http://jumpstart.doublenegative.com.au:8080/jumpstart/

I think you then add the fix for JBoss 5.1, ie. -Djboss.vfs.forceCopy=false

Please let us know how it goes!

Geoff

On 16/03/2010, at 10:36 PM, jaques robert wrote:

> Hello,
> 
> I'm trying to run Tapestry 5.1 with JBoss 5.1. However, I'm still having this 
> error :
> <<
> 09:58:56,329 ERROR [RequestExceptionHandler] Processing of request failed 
> with uncaught exception: Unable to resolve 'pagelink' to a component class 
> name.  Available component types: (none).
> org.apache.tapestry5.ioc.internal.util.TapestryException: Unable to resolve 
> 'pagelink' to a component class name.  Available component types: (none). [at 
> classpath:com/pouet/repository/wizard/tapestry/pages/Index.tml, line 15]
>        at 
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.startComponent(PageLoaderImpl.java:742)
>        at 
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:614)
>>> 
> 
> 
> I've looked in the mail archive of Tapestry-Users and saw :
> 
> <<
> 
> ok, I found solution for JBoss 5.1.0. 
> It's enough to use the same url
> converter that Geoff pointed out and add "-Djboss.vfs.forceCopy=false" 
> to JBoss JAVA_OPTS. At least, it solved the problem for me :) 
> enjoy,
> m. 
>>> 
> 
> So I've added the -Djboss.vfs.forceCopy=false argument, however it doesn't 
> solve anything... 
> 
> I saw this case opened https://issues.apache.org/jira/browse/TAP5-576, 
> however the status is "Won't fix" :(
> 
> I've read also that providing another implementation of  
> ClasspathURLConverter could resolve it : 
> "http://www.mail-archive.com/users@tapestry.apache.org/msg31403.html";
> 
> However, how can I plug this classpathurlconverter to my existing project ?
> 
> Does somebody 
> already managed to resolve this problem ?
> 
> Regards,
> mondes_engloutis.
> 
> 


      

Reply via email to