[jboss-user] [JBoss Portal] - Re: No bridge detected for application factory org.jboss.sea
jgilbert
do-not-reply at jboss.com
Wed Jul 4 17:04:57 EDT 2007
its not pretty but i got it to work with the following change. i hope there is a better way.
| public class JSFMetaBridgeFactory
| {
|
| /** . */
| private static final Logger log = Logger.getLogger(JSFMetaBridgeFactory.class);
|
| private static boolean isJsf12() {
| try {
| Object af = FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
| java.lang.reflect.Method m = af.getClass().getMethod("getApplication", new Class[]{});
| Object app = m.invoke(af, new Object[]{});
| if ("org.jboss.seam.jsf.SeamApplication12".equals(app.getClass().getName())) {
| return true;
| } else {
| return false;
| }
| } catch (Exception e) {
| throw new RuntimeException(e);
| }
| }
|
| public static JSFMetaBridge getMetaBridge()
| {
| JSFMetaBridge metaBridge = null;
|
| //
| String className = FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY).getClass().getName();
| if ("com.sun.faces.application.ApplicationFactoryImpl".equals(className))
| {
| metaBridge = new SunRIJSFBridge();
| }
| else if ("org.apache.myfaces.application.ApplicationFactoryImpl".equals(className))
| {
| metaBridge = new MyFacesJSFBridge();
| }
| else if ("org.jboss.seam.jsf.SeamApplicationFactory".equals(className))
| {
| if (isJsf12()) {
| metaBridge = new SunRIJSFBridge();
| } else {
| metaBridge = new MyFacesJSFBridge();
| }
| }
|
| //
| if (metaBridge != null)
| {
| log.debug("Detected JSF bridge " + metaBridge.getName());
| }
| else
| {
| log.warn("No bridge detected for application factory " + className);
| }
|
| //
| return metaBridge;
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060578#4060578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060578
More information about the jboss-user
mailing list