Thanks for your welcoming comments. I thought you might be interested to know
that
I managed to get a very simple JSF / CODI / OpenWebBeans app running on
glassfish
3.1. This has a single @Named @ViewAccessScoped bean, but nontheless it's a
good
start:

'Used CDI implementation: OpenWebBeans v1.1.0'

What's not quite so good is that in the main application we use
Jersey/JAX-RS client
and server and it is (presumably) getting confused by the choice of
implementations.
I'll see if I can figure anything out with the Jersey team tomorrow, perhaps
there's a
config parameter I can set or something.

It's a very nice feature that you can just comment out the listener in
web.xml to go
back to weld, it's extremely convenient at this stage.

Strangely, with Jersey sitting on the server classpath, I'm able to
successfully
deploy the simple OWB app only immediately after server startup. If I
attempt to
redeploy a 2nd time without restarting the server I hit the Jersey problem:

...
INFO: added beans.xml marker: jndi:/server/testOwb/WEB-INF/beans.xml
SEVERE: java.lang.NullPointerException
        at
com.sun.jersey.server.impl.cdi.CDIExtension.processAnnotatedField(CDIExtension.java:588)
        at
com.sun.jersey.server.impl.cdi.CDIExtension.processAnnotatedType(CDIExtension.java:344)
        at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...

Here is the full server log from a server restart + redeployment of the
hello world app:

Launching GlassFish on Felix platform
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy
for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Grizzly Framework 1.9.31 started in: 156ms - bound to [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.31 started in: 124ms - bound to [0.0.0.0:3700]
INFO: Grizzly Framework 1.9.31 started in: 202ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.31 started in: 31ms - bound to [0.0.0.0:7676]
INFO: Grizzly Framework 1.9.31 started in: 140ms - bound to [0.0.0.0:4848]
INFO: The Admin Console is already installed, but not yet loaded.
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port
[0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port
[0.0.0.0:8181]
INFO: WEB0169: Created HTTP listener [admin-listener] on host/port
[0.0.0.0:4848]
INFO: WEB0171: Created virtual server [server]
INFO: WEB0171: Created virtual server [__asadmin]
INFO: WEB0172: Virtual server [server] loaded default web module []
INFO: core.start_container_done
INFO: SEC1002: Security Manager is OFF.
INFO: SEC1010: Entering Security Startup Service
INFO: SEC1143: Loading policy provider
com.sun.enterprise.security.provider.PolicyWrapper.
INFO: SEC1115: Realm [admin-realm] of classtype
[com.sun.enterprise.security.auth.realm.file.FileRealm] successfully
created.
INFO: SEC1115: Realm [file] of classtype
[com.sun.enterprise.security.auth.realm.file.FileRealm] successfully
created.
INFO: SEC1115: Realm [certificate] of classtype
[com.sun.enterprise.security.auth.realm.certificate.CertificateRealm]
successfully created.
INFO: SEC1115: Realm [SportQuestRealm] of classtype
[com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm] successfully
created.
INFO: SEC1115: Realm [CustomLoginRealm] of classtype
[uk.co.sportquest.general.CustomLoginRealm] successfully created.
INFO: SEC1011: Security Service(s) Started Successfully
INFO: WELD-000900 ${parsedVersion (osgiVersion})
INFO: Hibernate Validator 4.1.0.Final
INFO: Instantiated an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Initializing Mojarra 2.1.3 (FCS b02) for context '/testOwb'
INFO: Instantiated an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: OpenWebBeans Container is starting...
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-core-api-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-core-impl-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-jsf20-module-api-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-jsf20-module-impl-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-message-module-api-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker:
jar:file:/C:/Users/Brendan/Documents/NetBeansProjects/testOwb/build/web/WEB-INF/lib/myfaces-extcdi-message-module-impl-1.0.0.jar!/META-INF/beans.xml
INFO: added beans.xml marker: jndi:/server/testOwb/WEB-INF/beans.xml
INFO: All injection points were validated successfully.
INFO: OpenWebBeans Container has started, it took [1545] ms.
INFO: WEB0671: Loading application [testOwb] at [/testOwb]
INFO: CORE10010: Loading application testOwb done in 10,280 ms
INFO: GlassFish Server Open Source Edition 3.1 (43) startup time : Felix
(2,948ms), startup services(14,274ms), total(17,222ms)
INFO: JMXStartupService: Started JMXConnector, JMXService URL =
service:jmx:rmi://SportQuest:8686/jndi/rmi://SportQuest:8686/jmxrmi
INFO: Instantiated an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port
[0.0.0.0:8080]
INFO: Grizzly Framework 1.9.31 started in: 109ms - bound to [0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port
[0.0.0.0:8181]
INFO: Grizzly Framework 1.9.31 started in: 31ms - bound to [0.0.0.0:8181]
INFO: [Started] MyFaces CODI (Extensions CDI) Core v1.0.0
Used CDI implementation: OpenWebBeans v1.1.0
project-stage: Production
project-stage class:
org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage$Production
application-parameters:
   name:        javax.faces.PROJECT_STAGE
   value:        Development
   name:        com.sun.faces.validateXml
   value:        true
   name:        com.sun.faces.forceLoadConfiguration
   value:        true
config implementation:
org.apache.myfaces.extensions.cdi.core.api.config.CodiCoreConfig
   method:        isAdvancedQualifierRequiredForDependencyInjection
   value:        true
   method:        isConfigurationLoggingEnabled
   value:        true
   method:        isInvalidBeanCreationEventEnabled
   value:        false

WARNING: The value of the JSF 2 project stage (Development) is different
from the CODI project stage (Production)
INFO: [Started] MyFaces CODI JSF-Module v1.0.0 for JSF 2.0
Used JSF implementation: Mojarra v2.1.3-FCS
config implementation:
org.apache.myfaces.extensions.cdi.jsf.api.config.JsfModuleConfig
   method:        isInitialRedirectEnabled
   value:        true
   method:        isUseViewConfigsAsNavigationCasesEnabled
   value:        true
   method:        isInvalidValueAwareMessageInterpolatorEnabled
   value:        true
   method:        isAlwaysKeepMessages
   value:        true
config implementation:
org.apache.myfaces.extensions.cdi.core.api.scope.conversation.config.WindowContextConfig
   method:        isUrlParameterSupported
   value:        true
   method:        isUnknownWindowIdsAllowed
   value:        false
   method:        isAddWindowIdToActionUrlsEnabled
   value:        false
   method:        getWindowContextTimeoutInMinutes
   value:        60
   method:        getMaxWindowContextCount
   value:        64
   method:        isCloseEmptyWindowContextsEnabled
   value:        false
   method:        isEagerWindowContextDetectionEnabled
   value:        true
   method:        isCreateWindowContextEventEnabled
   value:        false
   method:        isCloseWindowContextEventEnabled
   value:        false
config implementation:
org.apache.myfaces.extensions.cdi.core.api.scope.conversation.config.ConversationConfig
   method:        getConversationTimeoutInMinutes
   value:        30
   method:        isScopeBeanEventEnabled
   value:        false
   method:        isAccessBeanEventEnabled
   value:        false
   method:        isUnscopeBeanEventEnabled
   value:        false
   method:        isStartConversationEventEnabled
   value:        false
   method:        isCloseConversationEventEnabled
   value:        false
   method:        isRestartConversationEventEnabled
   value:        false
   method:        isConversationRequiredEnabled
   value:        true
MessageContextConfig class:
org.apache.myfaces.extensions.cdi.message.impl.DefaultMessageContextConfig
   MessageInterpolator class: class
org.apache.myfaces.extensions.cdi.jsf.impl.message.FacesMessageInterpolator
   MessageResolver class: class
org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareApplicationMessagesMessageResolver
   MessageHandler class: class
org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareMessageHandler
   LocaleResolver class: class
org.apache.myfaces.extensions.cdi.jsf.impl.message.JsfAwareLocaleResolver
   FormatterFactory class: class
org.apache.myfaces.extensions.cdi.message.impl.DefaultFormatterFactory

[end of glassfish server log]

Regards,
Brendan.


Gerhard Petracek wrote:
> 
> basically you can use owb with glassfish. however, as far as i know you
> can't disable weld easily. -> owb would be used but you would have two cdi
> containers up and running.
> 
> regards,
> gerhard
> 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces
> 
> 
> 
> 2011/8/2 oversteer <[email protected]>
> 
>>
>> Thanks for your reply. I appreciate the position of CODI, I see it as
>> analagous to
>> Seam, I think that's roughly correct.
>>
>> I'm very interested in OpenWebBeans, I've seen some performance figures
>> and
>> on the basis of them alone it looks like something worth using. The issue
>> is, can
>> I run it on glassfish? My current understanding which could be entirely
>> wrong is
>> no. Thinking about it, I'm really very interested in this.
>>
>> I see that there's a weld 1.1.2 release but glassfish requires the
>> weld-osgi-bundle
>> which doesn't seem to be available. I suppose I could build from source
>> but
>> we've
>> got a lot of application to develop and need to stick to core(ish)
>> responsibilities as
>> far as possible, or the job ain't gonna get done. That code won't write
>> itself.
>>
>> I'll try and find some time to give a 3.1.2 nightly a test, we couldn't
>> get
>> the 3.1.1
>> FCS working, and generally require a stable development environment as
>> you
>> would
>> expect.
>>
>> Thanks again.
>>
>>
>> struberg wrote:
>> >
>> > Hi oversteer!
>> >
>> > Glad you find CODI helpful!
>> > There are a few comments I'd like to make
>> >
>> > 1.) CODI is an Apache MyFaces subproject, but not tied to the MyFaces
>> JSF
>> > impl! CODI got coded only against the jsf-api and as such also works
>> > really fine with Mojarra and other JSF impls! Of course, taking the
>> > MyFaces JSF implementation is never a bad idea ;)
>> >
>> > 2.) CODI got implemented by a few Apache OpenWebBeans CDI container
>> > committers. But it's not bound to OWB neither!
>> > It got tested and runs really well on JBossAS7, Weld 1.1.2 and the
>> latest
>> > Glassfish nightly builds too. Of course, OpenWebBeans is by far the
>> > fastest CDI container around today ;) (that's up to > x10 faster
>> > sometimes).
>> >
>> > The problem you most probably face is that Glassfish-3.1 got the nick
>> name
>> > 'Crashfish' already, due to it's lots of bugs :)
>> > Otoh, once we (Matze Wessendorf and I) pointed the Glassfish team to
>> those
>> > bugs (and did a bit nose-rubbing on a conference and via twitter), they
>> > were really quick and fixed that bugs. I tested it with their nightly
>> > version and the bugs I experienced previously was gone.
>> >
>> > So could you please just try the lastest GF-3.2 build?
>> >
>> > Feel free to report back any success and also ping us if you need help
>> > with the transition to MyFaces and/or OpenWebBeans ;)
>> >
>> > txs and LieGrue,
>> > strub
>> >
>> > --- On Tue, 8/2/11, oversteer <[email protected]> wrote:
>> >
>> >> From: oversteer <[email protected]>
>> >> Subject: Glassfish 3.1 could not find Factory:
>> >> javax.faces.application.ApplicationFactory
>> >> To: [email protected]
>> >> Date: Tuesday, August 2, 2011, 12:16 PM
>> >>
>> >> I'm thinking of switching to MyFaces from Mojarra after
>> >> being impressed with
>> >> CODI
>> >> and would like to run some tests.
>> >>
>> >> On glassfish 3.1 I've added the useMyFaces &
>> >> useBundledJsf lines to
>> >> sun-web.xml,
>> >> and added the myfaces-bundle-2.1.1.jar to the classpath.
>> >> I've also tried
>> >> adding the
>> >> jars individually.
>> >>
>> >> On deployment I get this error:
>> >>
>> >> SEVERE: Exception while loading the app :
>> >> java.lang.IllegalStateException:
>> >> ContainerBase.addChild: start:
>> >> org.apache.catalina.LifecycleException:
>> >> java.lang.IllegalStateException: Application was not
>> >> properly initialized at
>> >> startup, could not find Factory:
>> >> javax.faces.application.ApplicationFactory
>> >>
>> >> Any ideas? I hope it's an easy one.
>> >> --
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Glassfish-3.1-could-not-find-Factory%3A-javax.faces.application.ApplicationFactory-tp32177395p32178172.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Glassfish-3.1-could-not-find-Factory%3A-javax.faces.application.ApplicationFactory-tp32177395p32182269.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to