[jira] [Commented] (DELTASPIKE-1228) ContextControl does not work in Websphere AS
[ https://issues.apache.org/jira/browse/DELTASPIKE-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15953037#comment-15953037 ] Matthias Wronka commented on DELTASPIKE-1228: - I solved the problem by implementing my own scope, that behaves similarly to the SessionScope when used from within a HttpSession but can also be controlled by API-calls when used from background-tasks. > ContextControl does not work in Websphere AS > > > Key: DELTASPIKE-1228 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1228 > Project: DeltaSpike > Issue Type: Bug >Affects Versions: 1.7.1 > Environment: Websphere 8.5.5.9 >Reporter: Matthias Wronka >Assignee: Mark Struberg > > I´m getting an Exception in Websphere Application Server 8.5.5.9 when I try > to start the SessionScope like this using ContextControl: > {code:java} > @Stateless > @RunAs("scheduled") > public class ScheduledService { > @Inject > private DemoConfiguration config; // contains SessionScoped references > @Inject > private ContextControl contextControl; > @Schedule(hour = "*", minute = "*") > private void doSth() { > contextControl.startContext(SessionScoped.class); > // ... use injected config-reference from above > contextControl.stopContext(SessionScoped.class); > } > } > {code} > The exception is: > {code} > java.lang.NoClassDefFoundError: org/apache/webbeans/config/WebBeansContext at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.getContextsService(OpenWebBeansContextControl.java:242) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startSessionScope(OpenWebBeansContextControl.java:154) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startContext(OpenWebBeansContextControl.java:80) > > {code} > I think this is because of a rather old owb-implementations, that Websphere > uses. I found the missing class in another package: > org/apache/webbeans/*context*/WebBeansContext. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DELTASPIKE-1228) ContextControl does not work in Websphere AS
[ https://issues.apache.org/jira/browse/DELTASPIKE-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15800737#comment-15800737 ] Matthias Wronka commented on DELTASPIKE-1228: - @[~struberg]: I updated the code-snipped from above to better illustrate what we´re trying to achieve. SessionContext and TransactionSynchronizsationRegistry should be present as we´re inside a SSB. Asynchornous Beans are not an option the method is called by timers. Sorry that I posted an incomplete code-snipped in the beginning :-( Is there another (better way) to access sessionscoped beans from scheduled methods? Otherwise we cannot reuse existing functionality in these situations. > ContextControl does not work in Websphere AS > > > Key: DELTASPIKE-1228 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1228 > Project: DeltaSpike > Issue Type: Bug >Affects Versions: 1.7.1 > Environment: Websphere 8.5.5.9 >Reporter: Matthias Wronka > > I´m getting an Exception in Websphere Application Server 8.5.5.9 when I try > to start the SessionScope like this using ContextControl: > {code:java} > @Stateless > @RunAs("scheduled") > public class ScheduledService { > @Inject > private DemoConfiguration config; // contains SessionScoped references > @Inject > private ContextControl contextControl; > @Schedule(hour = "*", minute = "*") > private void doSth() { > contextControl.startContext(SessionScoped.class); > // ... use injected config-reference from above > contextControl.stopContext(SessionScoped.class); > } > } > {code} > The exception is: > {code} > java.lang.NoClassDefFoundError: org/apache/webbeans/config/WebBeansContext at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.getContextsService(OpenWebBeansContextControl.java:242) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startSessionScope(OpenWebBeansContextControl.java:154) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startContext(OpenWebBeansContextControl.java:80) > > {code} > I think this is because of a rather old owb-implementations, that Websphere > uses. I found the missing class in another package: > org/apache/webbeans/*context*/WebBeansContext. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-1228) ContextControl does not work in Websphere AS
[ https://issues.apache.org/jira/browse/DELTASPIKE-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15799159#comment-15799159 ] Matthias Wronka commented on DELTASPIKE-1228: - We are currently using the Websphere Full Profile that seems to be shipped with owb. It might be, that my Code won't work in Websphere but it sure does in TomEE ... The purpose ist to start the Sessionscope within @Scheduled Methods. Anyway: thanks for your quick response. > ContextControl does not work in Websphere AS > > > Key: DELTASPIKE-1228 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1228 > Project: DeltaSpike > Issue Type: Bug >Affects Versions: 1.7.1 > Environment: Websphere 8.5.5.9 >Reporter: Matthias Wronka > > I´m getting an Exception in Websphere Application Server 8.5.5.9 when I try > to start the SessionScope like this using ContextControl: > {code:java} > @Inject > private ContextControl contextControl > private void doSth() { > contextControl.startContext(SessionScoped.class); > } > {code} > The exception is: > {code} > java.lang.NoClassDefFoundError: org/apache/webbeans/config/WebBeansContext at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.getContextsService(OpenWebBeansContextControl.java:242) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startSessionScope(OpenWebBeansContextControl.java:154) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startContext(OpenWebBeansContextControl.java:80) > > {code} > I think this is because of a rather old owb-implementations, that Websphere > uses. I found the missing class in another package: > org/apache/webbeans/*context*/WebBeansContext. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-1228) ContextControl does not work in Websphere AS
[ https://issues.apache.org/jira/browse/DELTASPIKE-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15798983#comment-15798983 ] Mark Struberg commented on DELTASPIKE-1228: --- But 8.5.5.9 is still shipped with OWB. Or do you use Liberty? Liberty provides both Weld and OWB. In any case it sadly won't work anyway I fear :( Reason is that you not only need to start the CDI context but also various ThreadLocals like the EJB SessionContext, TransactionSynchronisationRegistry, etc. In case of WAS I suggest you use a @Singleton EJB with an @Asynchronous method and inside of it you can call CDI beans without any problems. Please note that @SessionScoped is not applicable for non-Servlet threads anyway. It will almost always give you a ContextNotActiveException. This has nothing to do with WAS and not even with CDI (the same restriction exists for e.g. JSF @SessionScoped and EJBs). > ContextControl does not work in Websphere AS > > > Key: DELTASPIKE-1228 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1228 > Project: DeltaSpike > Issue Type: Bug >Affects Versions: 1.7.1 > Environment: Websphere 8.5.5.9 >Reporter: Matthias Wronka > > I´m getting an Exception in Websphere Application Server 8.5.5.9 when I try > to start the SessionScope like this using ContextControl: > {code:java} > @Inject > private ContextControl contextControl > private void doSth() { > contextControl.startContext(SessionScoped.class); > } > {code} > The exception is: > {code} > java.lang.NoClassDefFoundError: org/apache/webbeans/config/WebBeansContext at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.getContextsService(OpenWebBeansContextControl.java:242) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startSessionScope(OpenWebBeansContextControl.java:154) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startContext(OpenWebBeansContextControl.java:80) > > {code} > I think this is because of a rather old owb-implementations, that Websphere > uses. I found the missing class in another package: > org/apache/webbeans/*context*/WebBeansContext. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-1228) ContextControl does not work in Websphere AS
[ https://issues.apache.org/jira/browse/DELTASPIKE-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15798563#comment-15798563 ] John D. Ament commented on DELTASPIKE-1228: --- Newer versions of websphere ship with Weld, not OpenWebBeans. The version you're using should be using Weld. > ContextControl does not work in Websphere AS > > > Key: DELTASPIKE-1228 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1228 > Project: DeltaSpike > Issue Type: Bug >Affects Versions: 1.7.1 > Environment: Websphere 8.5.5.9 >Reporter: Matthias Wronka > > I´m getting an Exception in Websphere Application Server 8.5.5.9 when I try > to start the SessionScope like this using ContextControl: > {code:java} > @Inject > private ContextControl contextControl > private void doSth() { > contextControl.startContext(SessionScoped.class); > } > {code} > The exception is: > {code} > java.lang.NoClassDefFoundError: org/apache/webbeans/config/WebBeansContext at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.getContextsService(OpenWebBeansContextControl.java:242) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startSessionScope(OpenWebBeansContextControl.java:154) > at > org.apache.deltaspike.cdise.owb.OpenWebBeansContextControl.startContext(OpenWebBeansContextControl.java:80) > > {code} > I think this is because of a rather old owb-implementations, that Websphere > uses. I found the missing class in another package: > org/apache/webbeans/*context*/WebBeansContext. -- This message was sent by Atlassian JIRA (v6.3.4#6332)