Filter not being invoked
Hi, I'm working on a bit of a demonstration w/ EE technologies working well with non-EE techs. I found a bit of an issue w/ TomEE I think. Take a look at this project: https://github.com/johnament/bootee/tree/master/spark If you run this using "mvn clean install tomee:run" TomEE will start up, and deploy the application. However, invoking any URL does not go through the filter. Now, i had this issue previously w/ an embedded Tomcat instance, but started using the default servlet in tomcat and that fixed the issue. I would be surprised if TomEE didn't already use the default servlet, so I'm not even thinking that. But any idea why its not executing my filter? One other thing I noticed, which doesn't look right, *INFO - Using annotated mode for file:/Users/johnament/src/bootee/spark/target/apache-tomee/webapps/spark-1.0-SNAPSHOT/WEB-INF/beans.xml looking all classes to find CDI beans, maybe think to add a beans.xml if not there or add the jar to exclusions.list* *INFO - Unable to set the web application class loader property [clearReferencesRmiTargets] to [true] as the property does not exist* In the first case, I have a valid beans.xml.
Re: signify of {} when i create a rest Response with a List
GenericEntity is an abstract class. You're instantiating an anonymous instance of it. On Mon, Aug 1, 2016 at 8:06 PM mauro2java2011wrote: > I try to understand how return a collection of object as response with rest > > > > > import javax.ws.rs.core.GenericEntity; > //... > @GET > public Response workshops() { > List workshops = ...//a list of entities > GenericEntity > l > ist = new GenericEntity >(workshops) *{}*; > return Response.ok(list).build(); > } > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/signify-of-when-i-create-a-rest-Response-with-a-List-tp4679566.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
Re: Can't read beans.xml (TomEE 1.7.4 + new Camel CDI)
Hi, Camel CDI relies on CDI 1.1 semantics. scan is a CDI 1.1 feature. TomEE 1.7 is Java EE 6, meaning its using CDI 1.0 not CDI 1.1. Though I do see a typo in their beans.xml, saying the version is 1.0 (that attribute is mostly ignored). You should try on the recently released TomEE 7. John On Mon, May 30, 2016 at 2:41 PM dimaswrote: > Hi All, > > I'm getting following error while deploying web app which is built using > Camel CDI component (2.17.1): > > May 30, 2016 10:52:38 AM org.apache.openejb.config.DeploymentLoader > mergeBeansXml > SEVERE: Unable to read beans.xml from: > > jar:file:/D:/Repository/kaltire/mix/fsa-tss2click-adapter/target/fsa-tss2click-adapter-1.0-SNAPSHOT/WEB-INF/lib/camel-cdi-2.17.1.jar!/META-INF/beans.xml > org.apache.openejb.OpenEJBException: Cannot unmarshall the beans.xml: > unexpected element (uri:"http://java.sun.com/xml/ns/javaee;, > local:"scan"). > Expected elements are > <{http://java.sun.com/xml/ns/javaee}decorators>,<{ > http://java.sun.com/xml/ns/javaee}interceptors>,<{ > http://java.sun.com/xml/ns/javaee}alternatives> > at > > org.apache.openejb.config.ReadDescriptors.readBeans(ReadDescriptors.java:652) > at > > org.apache.openejb.config.DeploymentLoader.mergeBeansXml(DeploymentLoader.java:1118) > at > > org.apache.openejb.config.DeploymentLoader.addBeansXmls(DeploymentLoader.java:1104) > at > > org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:1060) > at > > org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:784) > at > org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:218) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2196) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1147) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100) > at > > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130) > at > > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) > at > > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) > at > > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5416) > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > at > > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:663) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:622) > at > > org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:43) > at > org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:176) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at > > org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) > at > > org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) > at > > org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at > > org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) > at > > org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) > at > > org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) > at > > org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >
Re: Is this legit? @RequestScoped vs HttpServletRequest
I know Romain's done some work in this area before. Per the spec, its not required to work the way you have it defined. JAX-RS injection via @Context is only mandated to work in JAX-RS managed components. Try to use @Inject instead of @Context, that may be what was implemented in TomEE. That is mandated in EE7 (but not in EE6). John On Sun, May 8, 2016 at 7:36 AM Kiryswrote: > I'm am making some experiments > and I've written this cdi called from within a jsf page > but I get a nullpointer exception is that a valid setup or is not legit > to get HttpServletRequest from within a request scoped cdi? > > Thank You > > Details follow: > > Apache Tomcat (TomEE)/7.0.68 (1.7.4) (plumee) > > CDI code extract > > @Named > @RequestScoped > public class UserProfileManager implements Serializable { > > @Context > private ServletContext context; > > @Context > private HttpServletRequest request; > @Context > private HttpServletResponse response; > > public LoggedUser getUser() { > Enumeration names= request.getAttributeNames(); //null > pointer exception here -> request is not null > /* other not relevant code */ > > } > > > } >
Using EARs against TomEE 7 M1
Hi all, I was wondering, how does EAR support look in 7 M1? I was trying to port DeltaSpike to run tests against 7.0.0-M1 and it seems that most tests that rely on EAR deployment fail with this error. Any ideas would be very useful. John SEVERE - EjbTransactionUtil.handleSystemException: Not a local file but no prefix specified: target/arquillian-test-working-dir/6/jndiUtilsWarFileTest.ear. So can't resolve java.lang.IllegalArgumentException: Not a local file but no prefix specified: target/arquillian-test-working-dir/6/jndiUtilsWarFileTest.ear. So can't resolve at org.apache.openejb.loader.provisining.ProvisioningResolver.protocol(ProvisioningResolver.java:133) at org.apache.openejb.loader.provisining.ProvisioningResolver.realLocation(ProvisioningResolver.java:115) at org.apache.openejb.loader.ProvisioningUtil.realLocation(ProvisioningUtil.java:158) at org.apache.openejb.assembler.classic.Assembler.getAppInfo(Assembler.java:606) at org.apache.openejb.assembler.DeployerEjb.undeploy(DeployerEjb.java:406) at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:35) at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85) at org.apache.openejb.core.singleton.SingletonContainer._invoke(SingletonContainer.java:256) at org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:212) at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370) at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181) at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:350) at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240) at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:104) at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at
Re: INSTALL TOMEE with docker
Just wondering, are you working off of a tomee docker image? https://github.com/tomitribe/docker-tomee John On Sun, Nov 29, 2015 at 11:06 AM mauro2java2011wrote: > Hi all. > I am newbie to docker container. > I would try to install a my web app with tomee using docker container. > > Please i ask if exist a tutorial or article on a blog that explain to > install tomee with docker. > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/INSTALL-TOMEE-with-docker-tp4677016.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
Re: Running JBoss Dashbuilder on TomEE
On Fri, Jul 3, 2015 at 9:02 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: Le 3 juil. 2015 04:38, jmutawa jalal.almut...@gmail.com a écrit : Hello Mr. Romain, Thank you for your reply. I have added the suggested property in WEB-INF/application.properties, this is the error I now get: / SEVERE: CDI Beans module deployment failed org.apache.webbeans.exception.inject.DeploymentException: org.apache.webbeans.exception.WebBeansConfigurationException: Passivation capable beans must satisfy passivation capable dependencies. Bean : DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default] does not satisfy. Details about the Injection-point: Field Injection Point, field name : log, Bean Owner : [DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]/ Means an interceptor or decorator is not serializable on this bean. This seems to be the code it was originally complaining about: / package org.jboss.dashboard.ui.config.treeNodes; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.jboss.dashboard.ui.config.AbstractNode; import org.jboss.dashboard.ui.config.TreeNode; public final class RootNode extends AbstractNode { @Inject private WorkspacesNode workspacesNode; @Inject private ResourcesNode resourcesNode; @Inject private GlobalPermissionsNode globalPermissionsNode; @PostConstruct protected void init() { super.setSubnodes(new TreeNode[] {workspacesNode, resourcesNode, globalPermissionsNode}); } public String getId() { return root; } } / Yes, remiving final before class would be the fix. I'm actually very surprised that weld is allowing this. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Running-JBoss-Dashbuilder-on-TomEE-tp4675437p4675441.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Running JBoss Dashbuilder on TomEE
Actually, only normal scoped beans require non-final. @Dependent is not a normal scope. On Fri, Jul 3, 2015 at 9:50 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: They allows things not spec compliant in 2 cases: - for perf reason - cause their impl doesnt care this is a known difference with OWB but sadly if they dont test their app on both servers they dont use CDI but Weld as container (ie using the spec API/binaries but not the associated behavior). Romain Manni-Bucau @rmannibucau https://twitter.com/rmannibucau | Blog http://rmannibucau.wordpress.com | Github https://github.com/rmannibucau | LinkedIn https://www.linkedin.com/in/rmannibucau | Tomitriber http://www.tomitribe.com 2015-07-03 15:41 GMT+02:00 John D. Ament johndam...@apache.org: On Fri, Jul 3, 2015 at 9:02 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: Le 3 juil. 2015 04:38, jmutawa jalal.almut...@gmail.com a écrit : Hello Mr. Romain, Thank you for your reply. I have added the suggested property in WEB-INF/application.properties, this is the error I now get: / SEVERE: CDI Beans module deployment failed org.apache.webbeans.exception.inject.DeploymentException: org.apache.webbeans.exception.WebBeansConfigurationException: Passivation capable beans must satisfy passivation capable dependencies. Bean : DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default] does not satisfy. Details about the Injection-point: Field Injection Point, field name : log, Bean Owner : [DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]/ Means an interceptor or decorator is not serializable on this bean. This seems to be the code it was originally complaining about: / package org.jboss.dashboard.ui.config.treeNodes; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.jboss.dashboard.ui.config.AbstractNode; import org.jboss.dashboard.ui.config.TreeNode; public final class RootNode extends AbstractNode { @Inject private WorkspacesNode workspacesNode; @Inject private ResourcesNode resourcesNode; @Inject private GlobalPermissionsNode globalPermissionsNode; @PostConstruct protected void init() { super.setSubnodes(new TreeNode[] {workspacesNode, resourcesNode, globalPermissionsNode}); } public String getId() { return root; } } / Yes, remiving final before class would be the fix. I'm actually very surprised that weld is allowing this. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Running-JBoss-Dashbuilder-on-TomEE-tp4675437p4675441.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Running JBoss Dashbuilder on TomEE
On Fri, Jul 3, 2015 at 9:59 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: 2015-07-03 15:55 GMT+02:00 John D. Ament johndam...@apache.org: Actually, only normal scoped beans require non-final. @Dependent is not a normal scope. sure but if it is intercepted or decorated it should be proxiable ie not final for CDI I don't see either of those in use in the code sample provided. On Fri, Jul 3, 2015 at 9:50 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: They allows things not spec compliant in 2 cases: - for perf reason - cause their impl doesnt care this is a known difference with OWB but sadly if they dont test their app on both servers they dont use CDI but Weld as container (ie using the spec API/binaries but not the associated behavior). Romain Manni-Bucau @rmannibucau https://twitter.com/rmannibucau | Blog http://rmannibucau.wordpress.com | Github https://github.com/rmannibucau | LinkedIn https://www.linkedin.com/in/rmannibucau | Tomitriber http://www.tomitribe.com 2015-07-03 15:41 GMT+02:00 John D. Ament johndam...@apache.org: On Fri, Jul 3, 2015 at 9:02 AM Romain Manni-Bucau rmannibu...@gmail.com wrote: Le 3 juil. 2015 04:38, jmutawa jalal.almut...@gmail.com a écrit : Hello Mr. Romain, Thank you for your reply. I have added the suggested property in WEB-INF/application.properties, this is the error I now get: / SEVERE: CDI Beans module deployment failed org.apache.webbeans.exception.inject.DeploymentException: org.apache.webbeans.exception.WebBeansConfigurationException: Passivation capable beans must satisfy passivation capable dependencies. Bean : DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default] does not satisfy. Details about the Injection-point: Field Injection Point, field name : log, Bean Owner : [DashboardHandler, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,org.jboss.dashboard.ui.components.DashboardHandler, java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]/ Means an interceptor or decorator is not serializable on this bean. This seems to be the code it was originally complaining about: / package org.jboss.dashboard.ui.config.treeNodes; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.jboss.dashboard.ui.config.AbstractNode; import org.jboss.dashboard.ui.config.TreeNode; public final class RootNode extends AbstractNode { @Inject private WorkspacesNode workspacesNode; @Inject private ResourcesNode resourcesNode; @Inject private GlobalPermissionsNode globalPermissionsNode; @PostConstruct protected void init() { super.setSubnodes(new TreeNode[] {workspacesNode, resourcesNode, globalPermissionsNode}); } public String getId() { return root; } } / Yes, remiving final before class would be the fix. I'm actually very surprised that weld is allowing this. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Running-JBoss-Dashbuilder-on-TomEE-tp4675437p4675441.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: TomEE plans for Java EE 7
Hey all, First, cudos to Roberto for taking on the TomEE support! It came to my mind after speaking w/ David @ JavaOne about EE7 status. So quick question. If we put in hibernate in the TomEE profile, that should deploy fine right? I'm not saying for you guys to put it in, but for the sake of the EE sample tests that might help with the JPA 2.1 tests. John On Wed, Nov 5, 2014 at 12:06 PM, Roberto Cortez radcor...@yahoo.com.invalid wrote: Great! Thanks, I'll add it in the next run :) From: Romain Manni-Bucau rmannibu...@gmail.com To: Roberto Cortez radcor...@yahoo.com Cc: users@tomee.apache.org users@tomee.apache.org; David Blevins david.blev...@gmail.com Sent: Wednesday, November 5, 2014 5:01 PM Subject: Re: TomEE plans for Java EE 7 seems tomee embedded profile misses at least (tomee-embedded doesn't provide it by default, tomee-plus should if you want to use tomee-remote with plus classifier configured): dependency groupIdorg.apache.batchee/groupId artifactIdbatchee-jbatch/artifactId version0.2-incubating/version /dependency dependency groupIdorg.apache.johnzon/groupId artifactIdjohnzon-core/artifactId version0.1-incubating/version /dependency Romain Manni-Bucau @rmannibucau http://www.tomitribe.com http://rmannibucau.wordpress.com https://github.com/rmannibucau 2014-11-05 16:55 GMT+00:00 Romain Manni-Bucau rmannibu...@gmail.com: great, thks Romain Manni-Bucau @rmannibucau http://www.tomitribe.com http://rmannibucau.wordpress.com https://github.com/rmannibucau 2014-11-05 16:51 GMT+00:00 Roberto Cortez radcor...@yahoo.com: Ok, Jenkins archiving was killing the machine disk space. I had to delete and create a new job. It's running now and should be accessible on the same url: https://javaee-support.ci.cloudbees.com/job/javaee7-samples-tomee-2.0/ From: Roberto Cortez radcor...@yahoo.com.INVALID To: Romain Manni-Bucau rmannibu...@gmail.com; users@tomee.apache.org users@tomee.apache.org Cc: David Blevins david.blev...@gmail.com Sent: Wednesday, November 5, 2014 4:42 PM Subject: Re: TomEE plans for Java EE 7 Yeah give me a sec, the job was taking too much space From: Romain Manni-Bucau rmannibu...@gmail.com To: users@tomee.apache.org users@tomee.apache.org; Roberto Cortez radcor...@yahoo.com Cc: David Blevins david.blev...@gmail.com Sent: Wednesday, November 5, 2014 4:38 PM Subject: Re: TomEE plans for Java EE 7 Hello Roberto, is it broken again? I get 404 Romain Manni-Bucau @rmannibucau http://www.tomitribe.com http://rmannibucau.wordpress.com https://github.com/rmannibucau 2014-11-05 11:44 GMT+00:00 Roberto Cortez radcor...@yahoo.com.invalid : Hi, We got our account back, so the tests are now running in CI with the latest TomEE 2.0 SNAPSHOT: https://javaee-support.ci.cloudbees.com/job/javaee7-samples-tomee-2.0/ Cheers, Roberto From: Roberto Cortez radcor...@yahoo.com To: David Blevins david.blev...@gmail.com; users@tomee.apache.org users@tomee.apache.org Sent: Monday, November 3, 2014 9:19 AM Subject: Re: TomEE plans for Java EE 7 Hi David, Thanks for a warm welcome :) The samples are setup with TomEE 2.0-SNAPSHOT already. We were using the Cloudbees - Jenkins FOSS, but for some reason it's unavailable. They are looking into it. Cheers,Roberto From: David Blevins david.blev...@gmail.com To: users@tomee.apache.org; Roberto Cortez radcor...@yahoo.com Sent: Monday, November 3, 2014 8:24 AM Subject: Re: TomEE plans for Java EE 7 First -- welcome, Roberto! Great to see you on the list :) We should definitely try with TomEE 2.0-SNAPSHOT. Would be great to track these. What CI are you using? We could set something up on the Apache side if needed. -David On Sun, Nov 2, 2014 at 1:35 PM, Roberto Cortez radcor...@yahoo.com.invalid wrote: Hi guys, I just subscribed to the list, so this is my first email here. I'm currently contributing to a Java EE 7 samples project here: https://github.com/javaee-samples/javaee7-samples, and I just added profiles to run the samples in TomEE and TomEE Embedded. Running the samples / tests we got the following results: batch - No Implementation Providedcdi - Failing a few tests. Most are related with the absence of a beans.xmlconcurrency - Failing a few tests. DefaultManagedExecutorService not binded to JNDI comp/DefaultManagedExecutorServiceejb - Failure in TimerServiceel - Missing Lambda Supportinterceptor - OKjacc - No Implementation Providedjaspic - No Implementation Providedjavamail - OKjaxrs - Failing a few tests. Related with other specs,
Re: Activemq embedded + createSession : unable to make it work!
Correct, you're using container managed transactions. You cannot call commit. On Thu, Oct 9, 2014 at 8:58 AM, joeleclems joelecl...@free.fr wrote: i tried different kind of transaction within EJB. Here are results of my tests : 1. Inject a CMT EJB to receive message. My EJB : @Stateless @TransactionManagement(TransactionManagementType.CONTAINER) public class MyCMTEjbReceiver implements ICMTEjbReceiver, ExceptionListener { ... @Override @TransactionAttribute(TransactionAttributeType.REQUIRED) public void receiveMessage(int pType) { ... } When i call session.commit() in receiveMessage method, i have this exception : javax.jms.TransactionInProgressException: Cannot commit() if an XA transaction is already in progress at org.apache.activemq.TransactionContext.commit(TransactionContext.java:304) at org.apache.activemq.ra.ManagedTransactionContext.commit(ManagedTransactionContext.java:62) at org.apache.activemq.ActiveMQSession.commit(ActiveMQSession.java:574) at org.apache.activemq.ra.ManagedSessionProxy.commit(ManagedSessionProxy.java:108) at org.apache.activemq.ActiveMQQueueSession.commit(ActiveMQQueueSession.java:72) at test_jms.receiver.MyCMTEjbReceiver.validateMessage(MyCMTEjbReceiver.java:192) at test_jms.receiver.MyCMTEjbReceiver.receiveMessage(MyCMTEjbReceiver.java:132) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:308) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:303) at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:92) at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:308) at com.sun.proxy.$Proxy123.receiveMessage(Unknown Source) at test_jms.receiver.ServletControlReceiver.activateCMTEjbReceiver(ServletControlReceiver.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at
Re: Regarding CDI scope and @Asynchronous EJB methods
Hi, I would say no to #2. Thread != RequestScoped. If you want to start a request scope with the thread, DeltaSpike has a CDIControl module that can do this for you. John On Mon, Oct 6, 2014 at 11:08 AM, Lars-Fredrik Smedberg itsme...@gmail.com wrote: When executing an EJB @Asynchronous method I know that valid CDI scopes are request and application. 1. Since @ApplicationScoped beans are available I assume that its better to inject those in the actual code being executed rather than passing them as arguments to the @Asynchronous method, correct? 2. Since the @Asynchronous method starts a new thread any @RequestScoped beans passed in will be recreated right when the first business method on them are called, correct? 3. The above leaves me (if correct) with choosing between passing a normal POJO (created with new) or an injected @Dependent scoped CDI Managed Bean to an @Asynchronous EJB method, the choice depends on wether the object passed needs to inject anything, correct? -- Med vänlig hälsning / Best regards Lars-Fredrik Smedberg STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the address(es) and may contain confidential or privileged information. If you are not the intended recipient, please notify Lars-Fredrik Smedberg immediately at itsme...@gmail.com, and destroy all copies of this message and any attachments.
Re: Regarding @Inject vs @EJB for EJB
for all intents and purposes, as long as you're using @Local/@LocalBean @Inject should work the exact same as @EJB, regardless of SLSB/SFSB/Singleton. Obviously if you're in a Bean Archive you'll want to give your SFSB a scope so that the containers work with it properly but last time I tried this (e.g. @SessionScoped @Stateful) most containers did random stuff. On Fri, Oct 3, 2014 at 8:58 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: Well rule is simple: for @Stateless/@Singleton if CDI is enabled (beans.xml) @Inject = @EJB. For @Stateful @Inject only makes sense with a normal scope and here cdi handles the stateful lifecycle (no need to call @Remove). @EJB doesn't for for remote ejb excepted using TomEE specific feature like JndiProvider (often you use a @Produces externalizing the jndi properties). Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-10-03 17:19 GMT+02:00 Alex Soto asot...@gmail.com: It is never late to know sth new. But then if this is TomEE specific your are tight to TomEE and won t be able to run on wildfly fir example El divendres, 3 octubre de 2014, hwaastad he...@waastad.org va escriure: ...or use @inject all over and produce your remotes :-) br hw -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Regarding-Inject-vs-EJB-for-EJB-tp4672108p4672117.html Sent from the TomEE Users mailing list archive at Nabble.com. -- Enviat amb Gmail Mobile
Re: @Injected field of a @Injected field is null
You should annotate your REST endpoint to be something, e..g @Stateless or @RequestScoped On Wed, Jun 4, 2014 at 11:40 AM, Vamsee Lakamsani vam...@yahoo.com.invalid wrote: One of the null injection problems in our main app had to do with the fact that we are using Quartz directly and as expected injection won't work in a Quartz managed thread. We were able to workaround that by doing a JNDI lookup of our EJB in java:global Digressing a little bit, when we started looking at Quartz and TomEE we started off at this page: http://tomee.apache.org/examples-trunk/quartz-app/README.html We did not go the resource adapter route because the first few lines of that doc say to use the EJB 3.1 @Scheduler. But I have not been able to find any docs on how to setup TomEE to use a custom data source for scheduling info (like the Quartz clustered scheduler). It seems there is a feature Glassfish: http://stackoverflow.com/questions/13292473/set-configure-the-ejb-timer-services-datasource From: Andy Gumbrecht agumbre...@tomitribe.com To: users@tomee.apache.org Sent: Wednesday, June 4, 2014 1:58 AM Subject: Re: @Injected field of a @Injected field is null If you are using maven just replace version 1.6.0.1 with version 1.7.0-SNAPSHOT in your pom.xml, else download it from here: http://tomee.apache.org/download/tomee-1.7.0-snapshot.html Andy. On 04/06/2014 07:52, Vamsee Lakamsani wrote: You are right. I pushed an update to my repo by adding a hello() business method. In the debugger MyDao becomes non-null when the method is entered. I do have a case in my larger app where I 'm seeing nulls even in the business method. Let me see if I can reproduce that in this small app. Thanks. From: Romain Manni-Bucau rmannibu...@gmail.com To: users@tomee.apache.org users@tomee.apache.org; Vamsee Lakamsani vam...@yahoo.com Sent: Tuesday, June 3, 2014 10:37 PM Subject: Re: @Injected field of a @Injected field is null works great on trunk. side note: bean instantiation is not done while ejb *business* method is not called for ejb and any method for cdi beans Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-06-04 3:49 GMT+02:00 Vamsee Lakamsani vam...@yahoo.com.invalid: I put together a small sample app here: https://github.com/lakamsani/cdi-nested MyResource is a JAX-RS service into MyService is @Injected MyDao is in-turn @Injected into MyService. When I run it (in TomEE 1.6.0.1), MyDao is null inside the MyService instance injected to MyResource. What do I need to do to make it work or is there another way of doing this (short of explicitly instantiating objects). -- Andy Gumbrecht http://www.tomitribe.com agumbre...@tomitribe.com https://twitter.com/AndyGeeDe TomEE treibt Tomitribe! | http://tomee.apache.org
Re: DeltaSpike + Arquillian + Apache TomEE
When you say default is local, do you mean embedded? It's possible that when in embedded mode, the extension isn't getting started. Can you try explicitly adding it to your archive? On Sun, Jun 1, 2014 at 4:51 PM, Alex Soto asot...@gmail.com wrote: Hi, I am writing a tutorial about how to inject properties files in CDI POJOs using DeltaSpike. You can find code here: https://github.com/tomitribe/community/tree/master/injecting-properties and the test here: https://github.com/tomitribe/community/blob/master/injecting-properties/src/test/java/org/superbiz/cdi/properties/MongoDbFactoryTest.java I am using the Arquillian Embed Adapter for Apache TomEE, and it is funny one thing I have seen. If I run the test over Servlet 3.0 protocol then it works, but if I run the test using the default (which is local) it throws a NullPointerException (basically because values are not injected). Any idea? Probably something related with classpath. -- +--+ Alex Soto Bueno www.lordofthejars.com +--+
Re: TomEE and CDI
Hi, Actually when you directly instantiate a class, you bypass CDI. In order to use CDI, your servlet needs this: @Inject private Exam exam; Within the class itself. John On Sun, May 4, 2014 at 5:53 AM, john77eipe john77e...@gmail.com wrote: I'm a start in CDI. To test CDI. I created 2 classes. public class Exam { @Inject private Student student; private int examCode; @PostConstruct private void init(){ System.out.println(Init in Exam); this.setExamCode(11); } } public class Student { private String name; @PostConstruct public void init(){ System.out.println(Init in Student); this.name = John Eipe; } } Isn't it possible to do this in Servlet's doGet. Exam exam = new Exam(); System.out.println(exam); But I don't see Injection happening. -- View this message in context: http://openejb.979440.n4.nabble.com/TomEE-and-CDI-tp4669131.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Trying to read JSON using Jackson in TomEE
It's odd that it would come over as a query param. Can you check the actual HTTP request your client is making? On Sat, Mar 15, 2014 at 3:59 PM, fulltruth dlove...@gmail.com wrote: If I take out this line: @Consumes(MediaType.APPLICATION_JSON) ...don't set Content-Type on the AJAX call, and change the createUser method to this: public String createUser(@QueryParam(user) String userJSON) { try { ObjectMapper mapper = new ObjectMapper(); User userBean = mapper.readValue(userJSON, User.class); This works just fine. So Jackson can convert from JSON to the User class without any annotations. What I want is for TomEE to call Jackson and do this automatically. -- View this message in context: http://openejb.979440.n4.nabble.com/Trying-to-read-JSON-using-Jackson-in-TomEE-tp4668215p4668216.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: EJB in custom JAAS LoginModule
Hmmm.. I don't know if the JAAS spec or EE specs either state that you can inject into login modules. On Thu, Mar 13, 2014 at 12:42 PM, Piercarlo Alberto Beghetto - Diennea piercarlo.beghe...@diennea.com wrote: I still have problem in integration with LoginModule and EJBs. What i've done is this: *1. *Created a class implementing LoginModule with inside the reference of my @Stateless EJB The JAAS customization works fine, i can simply access the LoginModule's methods, but my EJB is not initialized. public class JAASLoginModule implements LoginModule { @EJB private UserService userService; /* method implementation ...*/ } *2. *Defined the handler to catch the login public class JAASCallbackHandler implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { /* implementations */ } } *3. *Defined some custom Principals to match with my logic roles (i'd like to load roles from DB for each user) Am i missing something? Or it is simply a wrong approach? *Piercarlo Alberto Beghetto* Developer @ Diennea - MagNews Tel.: (+39) 0546 667432 - Int. 967 Viale G.Marconi 30/14 - 48018 Faenza (RA) [image: Magnews.it] http://www.magnews.it/it [image: Linkedin] http://www.linkedin.com/company/diennea---magnews [image: Twitter] http://twitter.com/DienneaMagNews [image: Facebook]http://www.facebook.com/pages/MagNews/197617841797 [image: Newsletter]http://www.magnews.it/it/iscriviti-alla-newsletter -- Rimani aggiornato sul mondo dell'email marketing e del digital marketing: visita il nostro blog! http://blog.magnews.it
Re: JAX-RS JSON unexpected element
Can you post the code for your resource? On Mon, Feb 24, 2014 at 2:05 PM, José Luis Cetina maxtorz...@gmail.com wrote: Hi, im doing my first rest service. Im having problem's with retrieving the json data, when my method is called i get an: WARNING: javax.xml.bind.UnmarshalException - with linked exception: [com.sun.istack.SAXParseException2; columnNumber: 0; unexpected element (uri:, local:id). Expected elements are {}conektaEvent,{}data] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:435) Do im missing something, any advice? Here is the json object that im trying to receive me in the post method: { id:521154c132611f5bc029, type:charge.paid, created_at:1376867521, data:{ object:{ id:521154c032611f5bc028, object:charge, livemode:false, created_at:1376867520, status:paid, currency:MXN, description:Autocinema Coyote - Eterno resplandor de una mente sin recuerdos, reference_id:XXYYZZ-TEST1234, failure_code:, failure_message:null, amount:2, paid_at:1377021230, fee:1160, payment_method:{ object:bank_transfer_payment, service_name:Conekta, service_number:127589, type:banorte, reference:0007131 }, details:{ name:Gustavo Delgado, phone:55, email:gustavo.delg...@gmail.com } }, previous_attributes:{ status:pending_payment, paid_at:1377021230 } } } Pojo: @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement() public class ConektaEvent implements Serializable{ @XmlAttribute(name=id) private String id; @XmlAttribute(name=type) private String type; @XmlElement(name=created_at) private Timestamp createdAt; @XmlElement(name=data, type = ConektaData.class) private ConektaData data; public ConektaEvent() { } //getters and setters } I have a /WEB-INF/resources.xml ?xml version=1.0 encoding=UTF-8? resources Service id=json class-name=org.apache.cxf.jaxrs.provider.json.JSONProvider SkipJaxbChecks = true DropRootElement = true SupportUnwrapped = true SingleJaxbContext = true /Service /resources Im newbie in jax-rs any help will be appreciated. Im using TomEE 1.6.0 JAX-RS
Re: JAX-RS JSON unexpected element
Actually I was curious for the code since it seems like he's referencing XML in the error, but sending JSON. On Mon, Feb 24, 2014 at 3:10 PM, Romain Manni-Bucau rmannibu...@gmail.com wrote: cause default provider is using jaxb model so it needs a wrapper. Jackson doesnt. (see jettison) Side note: you can put this conf in openejb-jar.xml Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-02-24 21:00 GMT+01:00 José Luis Cetina maxtorz...@gmail.com: Hi @John, the problem is in the @XmlRootElement, Jackson provider doesn't need it, then i just add Jackson as a provider and everything works. But i dont understand why with the default provider this doesn't work. I add the jackson dependecy and the -Dcxf.jaxrs.providers=com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider property. :) 2014-02-24 13:47 GMT-06:00 John D. Ament john.d.am...@gmail.com: Can you post the code for your resource? On Mon, Feb 24, 2014 at 2:05 PM, José Luis Cetina maxtorz...@gmail.com wrote: Hi, im doing my first rest service. Im having problem's with retrieving the json data, when my method is called i get an: WARNING: javax.xml.bind.UnmarshalException - with linked exception: [com.sun.istack.SAXParseException2; columnNumber: 0; unexpected element (uri:, local:id). Expected elements are {}conektaEvent,{}data] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:435) Do im missing something, any advice? Here is the json object that im trying to receive me in the post method: { id:521154c132611f5bc029, type:charge.paid, created_at:1376867521, data:{ object:{ id:521154c032611f5bc028, object:charge, livemode:false, created_at:1376867520, status:paid, currency:MXN, description:Autocinema Coyote - Eterno resplandor de una mente sin recuerdos, reference_id:XXYYZZ-TEST1234, failure_code:, failure_message:null, amount:2, paid_at:1377021230, fee:1160, payment_method:{ object:bank_transfer_payment, service_name:Conekta, service_number:127589, type:banorte, reference:0007131 }, details:{ name:Gustavo Delgado, phone:55, email:gustavo.delg...@gmail.com } }, previous_attributes:{ status:pending_payment, paid_at:1377021230 } } } Pojo: @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement() public class ConektaEvent implements Serializable{ @XmlAttribute(name=id) private String id; @XmlAttribute(name=type) private String type; @XmlElement(name=created_at) private Timestamp createdAt; @XmlElement(name=data, type = ConektaData.class) private ConektaData data; public ConektaEvent() { } //getters and setters } I have a /WEB-INF/resources.xml ?xml version=1.0 encoding=UTF-8? resources Service id=json class-name=org.apache.cxf.jaxrs.provider.json.JSONProvider SkipJaxbChecks = true DropRootElement = true SupportUnwrapped = true SingleJaxbContext = true /Service /resources Im newbie in jax-rs any help will be appreciated. Im using TomEE 1.6.0 JAX-RS -- --- *José Luis Cetina* ---
Re: Bean not instantiated
CODI is a set of CDI components, however it's more or less migrated over to DeltaSpike. I responded to your question on stack overflow. I generally agree with Romain's comment, injecting a logger makes very little sense, since you're just wrapping it (the LOC to make a logger producer far outweigh using a static final logger; using an instance level logger has certain distinctive behavior). On Sun, Jan 12, 2014 at 11:59 AM, Caterpillar caterpilla...@gmail.com wrote: Il 12/01/2014 17:44, Romain Manni-Bucau ha scritto: Side note: producing a logger is a wrong idea (see codi list to learn why) so maybe just get rid of it Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau What is codi list?
Re: reading the mailing list from the web
The link's directly on the page you referenced: http://openejb.markmail.org/search/?q=type:users On Sun, Jan 12, 2014 at 12:30 PM, Caterpillar caterpilla...@gmail.com wrote: Hi, I cannot find a way to read mailing list discussion from a webpage archive. I tried to look into http://openejb.apache.org/mailing-lists.html but I did not find any archive. I need to send a my discussion to a developer who made the example I am working on, to let him know feedbacks about his work and hopefully allowing him to improve it. Thank you.
Re: No message body writer has been found for response class
in most app servers you end up with lazy loading issues, especially for onetomany's or manytomany's. On Mon, Nov 25, 2013 at 1:44 PM, Thiago Veronezi thi...@veronezi.org wrote: I guess so, but I'm not sure how the managed entities would behave. imho, it's better to create DTOs to hold only the information you want to pass through the wire. []s, Thiago. On Mon, Nov 25, 2013 at 1:38 PM, José Luis Cetina maxtorz...@gmail.comwrote: Noup, i did it an works. What about if my object is an entity object? can i mix jpa annotations like @entity @column @joincolumn @onetone etc whit this annotations? 2013/11/25 Thiago Veronezi thi...@veronezi.org Did you annotate the User class? https://github.com/tveronezi/photodb/blob/master/src/main/java/photodb/data/dto/UserInfo.java []s, Thiago. On Mon, Nov 25, 2013 at 1:26 PM, José Luis Cetina maxtorz...@gmail.com wrote: Hi, im doing my first restful, im using tomee 1.6.0 jax-rs. I get this message when in my webpage: No message body writer has been found for response class User. @GET @Path(/user) @Produces({application/xml, application/json}) public User getUser(){ User usr = new User(); usr.setName(xx); return usr; } I never code any restful before. What im missing? -- --- *SCJA. José Luis Cetina* ---
Re: Works in Tomcat 7 8 but not in tomee 1.5 1.6
Please include something.. logs, error you're getting, etc. On Sun, Nov 17, 2013 at 7:28 AM, LG Optimusv lgoptimusv...@gmail.comwrote: Hi All, I have a web application without web.xml using Spring MVC and its Java Config. That application can be deployed in both tomcat and tomee but it doesn't run in tomee. Has anybody ever encountered the same issue? I don't attach an example here but if it's needed I can attach one. Thanks.
Re: hawtio to see all your tomee /java/ stuff
Actually, since hawt.io is simply using jolokia, any mbeans deployed to the same JVM will be returned to the client. It's simply a matter of building an angular.js UI that consumes the JSON and processes the data. On Thu, Nov 7, 2013 at 6:40 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: +1 On Thu, Nov 7, 2013 at 5:53 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: added an agent plugin to push tomee stateless stat + validation state of datasource not that sure which GUI plugin are needed ATM
Re: ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl
Also, I believe this is expected behavior per EE specs. The container may have a default provider, which an app can leverage. In containers like WebLogic, you can configure a different default but that requires specific configuration. Maybe it's possible to configure OpenEJB/TomEE to have a default provider other than OpenJPA, but I'm not sure how you would package that. On Sat, Nov 2, 2013 at 7:29 PM, Jean-Louis MONTEIRO jeano...@gmail.comwrote: Hi Matthias, The openejb-core-hibernate is just a helper pom. It aims at providing a easy way from an end user point of view to use Hibernate as the JPA provider instead of OpenJPA by default. The pom just excludes OpenJPA and includes Hibernate. If you wanna use OpenJPA, you have to use openejb-core instead of openejb-core-hibernate. Hope it helps JLouis 2013/11/3 Matthias Wessendorf mat...@apache.org Hello! On trunk, when removing the provider element of the persistence.xml ([1]) the openejb-core-hibernate module assumes that the OpenJPA impl. should be used. However, the test here fails, since it can not find the OpenJPA implementation; See stacktrace below. -Matthias [1] https://github.com/apache/tomee/blob/trunk/examples/jpa-hibernate/src/main/resources/META-INF/persistence.xml#L24 org.apache.openejb.OpenEjbContainer$AssembleApplicationException: org.apache.openejb.OpenEJBException: Creating application failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate: org.apache.openejb.OpenEJBRuntimeException: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl at org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:419) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56) at org.superbiz.injection.h3jpa.MoviesTest.test(MoviesTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) Caused by: org.apache.openejb.OpenEJBException: Creating application failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate: org.apache.openejb.OpenEJBRuntimeException: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612) at org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:415) ... 27 more Caused by: org.apache.openejb.OpenEJBException: org.apache.openejb.OpenEJBRuntimeException: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl: java.lang.ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758) ... 29 more Caused
Re: CDI Injecting parameterized types
The issue is that the CDI spec and EJB specs are not in alignment. EJB injection rules are at play here, and since they both implement the same interface you are running into this issue. If your classes were not annotated @Stateless this would not happen. On Mon, Oct 28, 2013 at 4:13 PM, Chris Owens ctag+open...@chris-owens.comwrote: My (beginner's) understanding of JSR-299 is that it recognizes parameterized types: MyInterface.java Class1.java Class2.java Class3.java I'm expecting var1 to be bound to a bean that implements Class2, but that isn't happening. Do I misunderstand how JSR-299 uses generics? -- View this message in context: http://openejb.979440.n4.nabble.com/CDI-Injecting-parameterized-types-tp4665761.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: ClassNotFoundExceptions on more than two Arquillian tests
Michiel, Just wondering, are you including hsqldb in your war file? John On Thu, Sep 19, 2013 at 11:10 AM, Michiel Graat michiel.gr...@sidn.nl wrote: Hi guys, I have been trying to use Arquillian/TomEE but I have run into a strange problem. Whenever I try to run more than two arquillian testclasses in one testrun I get ClassNotFoundExceptions for the org.hsqldb.jdbc.Util class. If I run the testclasses separately or two at a time everything works fine. I use arquillian 1.1.1.Final with TestNG, arquillian-tomee-remote 1.5.2 for webprofile and shrinkwrap 2.0.0. My deployment method looks like this: @Deployment public static WebArchive createDeployment() { File[] deps = Maven.resolver() .loadPomFromFile(pom.xml) .importRuntimeAndTestDependencies() .resolve().withTransitivity().asFile(); return ShrinkWrap.create(WebArchive.class, dbs.war) .addPackages(true, foo.bar.dbs) .addAsManifestResource(META-INF/test-persistence.xml, persistence.xml) .addAsWebInfResource(EmptyAsset.INSTANCE, beans.xml) .addAsLibraries(deps) .addAsResource(messages_nl.properties, messages_nl.properties); } I remember seeing HSQLDB lock errors when trying to run more than two testclasses but I cannot seem to reproduce them anymore. You can find a log of a failed run here (split into 3 parts, because its 1 MB total, lots of repetition of stacktraces though), in it I try to run three tests: http://pastebin.com/KvQtJ6LH (part 1) http://pastebin.com/Ww6rSDGw (part 2) http://pastebin.com/6YpdKXq4 (part 3) A successful run (two tests) can be found here: http://pastebin.com/2HBnAKPw This problem has kept me occupied for days now but I cannot seem to find the cause or a solution. Do you guys have any idea? Kind regards, Michiel
Re: TransactionAttribute
From the java ee 5 tutorial (don't think this changed in 6): http://docs.oracle.com/javaee/5/tutorial/doc/bncij.html Required Attribute If the client is running within a transaction and invokes the enterprise bean’s method, the method executes within the client’s transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method. The Required attribute is the implicit transaction attribute for all enterprise bean methods running with container-managed transaction demarcation. You typically do not set the Required attribute unless you need to override another transaction attribute. Because transaction attributes are declarative, you can easily change them later. John On Thu, Sep 5, 2013 at 8:09 PM, José Luis Cetina maxtorz...@gmail.com wrote: Hi i have an EJB annotated with: @Stateless @TransactionManagement(TransactionManagementType.CONTAINER) As you can see i don't mark the EJB with any TransactionAttribute, instead i use TransactionAttribute in every method when i need it, if i don't need any transaction (because i will only read information from database) then i don't use any TransactionAttribute in the method not event TransactionAttribute.NEVER. But today i realized that i have a method that IS NOT annotated with any TransactionAttribute (and the ejb class either) but in that method i query an entity and change some values (inside of the ejb method) of the retrieved entity, i could see that my entity is committed with those changes (this is not suppose to happens). I know if i mark the EJB with TransactionAttribute.XXX all the methods will use the same TransactionAttribute that is defined in the class, i know if i have the TransactionAttribute in the ejb class and in the method too, the method TransactionAttribute has major priority. But in my case i don't have any TransactionAttribute in the ejb class and in the method. Then why my entity is commited with those changes?, is the default value for TransactionAttribute using TransactionManagementType.CONTAINER is @TransactionAttribute(TransactionAttributeType.REQUIRED) or something like that?? If i annotated my method with @TransactionAttribute(TransactionAttributeType.NEVER) the entity is never persisted (required behavior), but if i add the @TransactionAttribute(TransactionAttributeType.REQUIRED) then the entity is persisted. My surprise is if i use @TransactionAttribute(TransactionAttributeType.REQUIRED) the entity is persisted but i never do a persist or merge, i know if the method never throw an exception the transaction is commited, but i never do a persist/merge. Do i have to mark all of my methods with @TransactionAttribute(TransactionAttributeType.NEVER)?? if yes, then i can assume that the default value for an EJB is @TransactionAttribute.REQUIRED??
Re: [TomEE 1.6.0 snapshot] OpenWebBeans skipped deployment of org.omnifaces.component.*
Looks like its time to yell at the OWB guys that their logging is too heavy :-) On Sun, Aug 18, 2013 at 10:20 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I am currently using TomEE 1.6.0 snapshot (apache-tomee-1.6.0-20130803.041148-142-plus.zip) with OmniFaces 1.6 snapshot (2013-08-12). Per my experience, the INFO log lines below are added to the log only if/when I am not using the omnifaces components in my app. The INFO log lines are a bit confusing. Are these INFO log lines correct, need to be fixed, or is there something that OmniFaces need to do to prevent these INFO log lines? As a developer, I should not have to adjust my logger settings and I should not have to use all components in the library, if I don't really need them. Please advise. Aug 18, 2013 10:08:26 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication INFO: OpenWebBeans Container is starting... Aug 18, 2013 10:08:26 PM org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [CdiPlugin] Aug 18, 2013 10:08:26 PM org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.input.ComponentIdParam reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.validator.ValidateAllOrNone reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.validator.ValidateAll reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.output.OutputLabel reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.output.Cache reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.tree.TreeNodeItem reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.validator.ValidateEqual reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.script.Highlight reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.tree.TreeInsertChildren reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.input.Form reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.script.CommandScript reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.input.ViewParam reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:27 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.validator.ValidateOne reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:28 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.output.ConditionalComment reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:28 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.validator.ValidateUnique reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:28 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.output.OutputFormat reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:28 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of: org.omnifaces.component.tree.TreeNode reason: java.lang.reflect.UndeclaredThrowableException Aug 18, 2013 10:08:28 PM org.apache.webbeans.config.BeansDeployer isValidManagedBean INFO: skipped deployment of:
Re: Fwd: JsonJaxbModule for JAX-RS 2.0
Hi, If you need to use a MessageBodyWriter, it needs to be annotated @Provider and implement the interface. http://jackson.codehaus.org/javadoc/jax-rs/1.0/javax/ws/rs/ext/MessageBodyWriter.html then it should get picked up automatically. On Fri, Jul 26, 2013 at 3:20 PM, Nick Khamis sym...@gmail.com wrote: Romain, i'm sorry I am drawing a blank. Could you please elaborate? I just have a simple resource: @GET @Produces({ MediaType.APPLICATION_JSON}) public ListWine findAll() { System.out.println(findAll); return dao.findAll(); } And a web.xml (3.0) pointing to the resource. This is for JAX-RS 2.0 and maven within TOMEE. Is there specific example that meets this simple scenario? I did find this simple example but could not see any mention of adding a json writer?: http://tomee.apache.org/examples-trunk/rest-example/README.html Sorry, a noob right now... Nick.
Re: Fwd: JsonJaxbModule for JAX-RS 2.0
The regular wine example should not be an issue on Tomee if you're using JAX-RS 1.1/1.0. I have no clue what you might need to do with JAX-RS 2.0 (this type of configuration is really not supportable at this time; you may want to try regular Tomcat + JAX-RS 2.0). On Fri, Jul 26, 2013 at 3:40 PM, Nick Khamis sym...@gmail.com wrote: Hello John, I was am running the following example: http://coenraets.org/blog/2011/12/restful-services-with-jquery-and-java-using-jax-rs-and-jersey/ Taking a closer look, his resources produce json, but there is no actually producing of JSON? Along with MessageBodyWriter what other options do we have? Thanks in advance, Nick.
Re: Fwd: JsonJaxbModule for JAX-RS 2.0
A single application server version only supports a single Java EE specification revision. Right now, the only Java EE 7 compliant application server is GlassFish. You can hack together some things (e.g. CDI 1.1 + JAX-RS 2.0) on Tomcat 7, but it's only going to go so far. On Fri, Jul 26, 2013 at 4:25 PM, Nick Khamis sym...@gmail.com wrote: John thank you so much for your response. What would one expect from a Tomcat+Jersey 2.0 combination. Would we have support for JAX-RS 2.0 stuff like: Resource Context (Request. Response), Filters (Request. Response) Interceptors (Writer, Reader), Async Context and Dependencies Injection 1.1 I hope these are not to stupid of a question. I always struggle with 1) Servlet Containers 2.5 vs 3.0 2) Application Servers supporting JEE 6,7,8,9,10,321... The needle that broke the back you know? Thanks in Advance, Nick.
Re: Oracle ADF Essential and TomEE+
Well, it probably works on Tomcat7 because you have to drop in the glassfish JSF runtime and JSTL. Since TomEE ships with JSF, that shouldn't be done here. However, looks like they have some bad XML. For example, the code tag here should be escaped: description If this attribute is set to an instance of codeoracle.adf.view.rich.model.PageTemplateModel/code, the view ID will be taken from the model and the model will receive notifications of the starting and stopping of the template context. Otherwise, if the value is non-null the value is assigned to the bindings EL variable while this template is rendering or decoding. /description On Sat, Jul 20, 2013 at 8:17 AM, toddler junggab.y...@gmail.com wrote: Dear Experts, I am really beginner of the Web Application development and I want to use framework for the this. Thus, I am trying to use Oracle ADF with TomEE+(Tomcat7). Even though Oracle posted compatibility table at the following URL: http://www.oracle.com/technetwork/developer-tools/jdev/documentation/1212-cert-1964670.html I could see some posting by people saying that ADF can be run with Tomcat 7. https://blogs.oracle.com/adfthoughts/entry/running_adf_essentials_in_tomcat And followed the instructions in the pages and still I am getting following errors: Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Cannot unmarshall the JSP tag library definition file: jar:file:/u02/RTE/apache-tomee-plus-1.5.2/webapps/rcf-dvt-demo/WEB-INF/lib/adf-richclient-impl-12-abrams-SNAPSHOT.jar!/META-INF/afu.tld: unexpected element (uri:http://java.sun.com/xml/ns/javaee;, local:code). Expected elements are {^@}text at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:1903) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1073) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1033) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more How can I overcome this error? Thank you. Br, Toddler -- View this message in context: http://openejb.979440.n4.nabble.com/Oracle-ADF-Essential-and-TomEE-tp4664275.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: singleton and interface injection question
How is it marked? @Local @LocalBean @Remote? On Tue, Jul 16, 2013 at 10:06 AM, amber ambe...@hotmail.fr wrote: Hi, why do I have to inject a @singleton bean only with its interface ? (I mean if a use the implementation class, OpenEJB failed) thx :) -- View this message in context: http://openejb.979440.n4.nabble.com/singleton-and-interface-injection-question-tp4664249.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: tomee+ and restful webservice
I would start on line 40 of this class: java.lang.NullPointerException at service.AbstractFacade.findAll(AbstractFacade.java:40) at service.OkoFacadeREST.findAll(OkoFacadeREST.java:66) Since you're getting a null pointer. On Tue, Jul 2, 2013 at 6:41 AM, omisaye_infotech omisaye_infot...@yahoo.com wrote: Hello to all my brother.pls i'm new to restful web service and also new in using the new apache TomeePlus .My aim of using restful webservice is to integrate it in my web e-comerce websit. FIRST: My IDE is Netbeans 7.3.1, In my sql ,I built a database called oko which is made up on table with ID,firstname and Lastname, this is just for testing purposes. in My netbeans i built a web app called AGAIN in thsi AGAIN I built entity beans from my Mysql database,entity class = Oko.java i built restful web service from entity class Oko.java; i used glassfish server 3.2. when i tested the restful webservice it work pretty well. i was very happy with this !!. SECOND : Now i tried to do thesame thing with my apache TomeePlus server , but it is not working . i included mysql driver jar file to TomeePlus /lib, i Fololwed the step on FIRST: it gave me an error which has kept me one week trying to resolve. ERROR : SEVERE: Servlet.service() for servlet [ServletAdaptor] in context with path [/AGAIN] threw exception java.lang.NullPointerException at service.AbstractFacade.findAll(AbstractFacade.java:40) at service.OkoFacadeREST.findAll(OkoFacadeREST.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at
Re: Websocket in TomEE
Isn't the tyrus license problematic for apache? On Tue, Jul 2, 2013 at 11:38 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: atmos or tyrus yes tomee is waiting for its stack for javaee 7 (tomcat is not released, OWB is not cdi 1.1 compliant, etc...) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/7/2 middleware davide.pasin...@infocamere.it So in TomEE 1.5.2 I can use annotations importing atmosphere? What are TomEE's plan for JEE7? -- View this message in context: http://openejb.979440.n4.nabble.com/Websocket-in-TomEE-tp4664043p4664067.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Problem with Entities in jars
But isn't it first the container that needs to find persistence.xml, since it needs to instantiate the provider? Don't you really have to pass in all of this config to the provider? For some reason I recall the provider being blind to the location of persistence.xml, other than by configuration (since in SE the provider is configured to read a persistence.xml) John On Wed, Jun 12, 2013 at 11:31 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: so it was right, the point is what do the providers, seems they use the webapp dir by default *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 daedalus m.nis...@eurokey.de Quote from the JPA 2.0 Spec Page 310: http://download.oracle.com/otndocs/jcp/persistence-2.0-fr-eval-oth-JSpec/ -- View this message in context: http://openejb.979440.n4.nabble.com/Problem-with-Entities-in-jars-tp4663695p4663723.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Problem with Entities in jars
Right, so the container needs to read persistence.xml, turn it into PersistenceUnitInfo and pass to the provider. On Wed, Jun 12, 2013 at 11:43 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: no, in JavaEE it has the PersistenceUnitInfo which contains this info *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 John D. Ament john.d.am...@gmail.com But isn't it first the container that needs to find persistence.xml, since it needs to instantiate the provider? Don't you really have to pass in all of this config to the provider? For some reason I recall the provider being blind to the location of persistence.xml, other than by configuration (since in SE the provider is configured to read a persistence.xml) John On Wed, Jun 12, 2013 at 11:31 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: so it was right, the point is what do the providers, seems they use the webapp dir by default *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 daedalus m.nis...@eurokey.de Quote from the JPA 2.0 Spec Page 310: http://download.oracle.com/otndocs/jcp/persistence-2.0-fr-eval-oth-JSpec/ -- View this message in context: http://openejb.979440.n4.nabble.com/Problem-with-Entities-in-jars-tp4663695p4663723.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: TomEE not supporting Validator injection
Why are you going to add it when it already works? On Wed, Jun 12, 2013 at 12:05 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: IIRC (didnt read it for months) but it sayd META-INF for jar and WEB-INF for wars btw i'll add the meta-inf support since that's quite common: https://issues.apache.org/jira/browse/TOMEE-975 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 John D. Ament john.d.am...@gmail.com spec section 4.4.6 says it goes in META-INF but you are reading it fine from WEB-INF/classes/META-INF so that's not an issue. Spec doesn't list WEB-INF anywhere in it. Issue is that I'm testing in TomEE 1.5.2, which is the released version. John On Wed, Jun 12, 2013 at 11:58 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: with: mvn test -Ptomee-build-managed -Dtomee.version=1.6.0-SNAPSHOT -Dowb.version=1.2.1-SNAPSHOT i get the injection, then the constraint validator is not enriched but not sure we read validation.xml in WEB-INF/classes/META-INF, probably just in WEB-INF as mentionned in the spec (i know others can do something different) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 John D. Ament john.d.am...@gmail.com @Romain https://github.com/johnament/deltaspike/blob/master/deltaspike/modules/beanval/impl/src/test/java/org/apache/deltaspike/beanval/test/InjectedValidationTest.java When the validator here is @Inject rather than created using @Before, it's not injected in the test case. John On Wed, Jun 12, 2013 at 12:37 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi It is supported and tested. What's your case? Le 12 juin 2013 06:09, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : John, Wow, this is a coincidence and interesting. We have been discussing TomEE/CDI topics, and now you bring this up. Please click the following URL and read that. :) http://code.google.com/p/omnifaces/issues/detail?id=183 Howard On Tue, Jun 11, 2013 at 10:23 PM, John D. Ament john.d.am...@gmail.com wrote: Hi all In section 3.6 of the CDI spec, it indicates that the Validator (javax.validation.Validator) should be a built in bean, meaning the container should support injection of it. I was testing something locally and i noticed that TomEE wasn't injecting this object. Is this expected? John
Re: Problem with Entities in jars
spec for validator says it goes in WEB-INF/classes/META-INF as well. So, web.xml, ejb-jar.xml, beans.xml go in WEB-INF validator.xml, persistence.xml, beans.xml go in WEB-INF/classes/META-INF Sounds like what we really have is an issue for the EE spec to sort out the proper place to put descriptors. John On Wed, Jun 12, 2013 at 3:07 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hmm weird, sure i saw the opposite...if not we have to open an issue since it would be the only descriptor being here (sure for ejb-jar, web, validator..) Le 12 juin 2013 18:45, John D. Ament john.d.am...@gmail.com a écrit : Spec says it goes in WEB-INF/classes/META-INF. In fact the spec says it should not work if it's directly in WEB-INF. On Wed, Jun 12, 2013 at 12:30 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: so the workaround is to put it in both places ;) joke apart i wonder why jboss and glassfish doesn't follow the spec (or did i misunderstood it? would be better probably, if not we could add a flag to do like them) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/12 daedalus m.nis...@eurokey.de Yes you're right. Placing the persistence.xml file directly in WEB-INF is working for TomEE. But neither Glassfish nor JBoss will recognize the persistence.xml in any folder different from WEB-INF/classes/META-INF -- View this message in context: http://openejb.979440.n4.nabble.com/Problem-with-Entities-in-jars-tp4663695p4663720.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Problem with Entities in jars
Sorry, when I refer to META-INF, I'm referring to WEB-INF/classes/META-INF. /META-INF is really just for JAR wrapper stuff (e.g. maven files) in WARs. On Wed, Jun 12, 2013 at 5:47 PM, Anthony Fryer apfr...@hotmail.com wrote: I always thought, for war files you put jee config files in WEB-INF (or WEB-INF/classes/META-INF), and for jars you put files in META-INF. Makes sense to me to put these files in WEB-INF because war files are different to jar files because they contain other jar files. Maybe the spec needs to be made really clear on this issue. Would seem strange to me to have a config file in WEB-INF/classes/META-INF referencing classes or jar files in WEB-INF/lib. But if other containers work that way (even if it may not be 100% spec compliant) then since tomee is awesome, adding that support would be great. -- View this message in context: http://openejb.979440.n4.nabble.com/Problem-with-Entities-in-jars-tp4663695p4663751.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: CODI + TomEE + ManagedBean with public attributes
Don't forget, most of these specs expect javabeans - POJOs w/ private fields getters/setters/issers. On Tue, Jun 11, 2013 at 12:54 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hmm, is it still a cdi bean then? I mean isnt there anything preventing it to be proxied or anything in the idea preventing it to be a cdi bean? Le 11 juin 2013 06:49, José Luis Cetina maxtorz...@gmail.com a écrit : Nop. If i just mark the fields as private the error goes away. El 10/06/2013 23:35, Romain Manni-Bucau rmannibu...@gmail.com escribió: Hi Didnt you put some part of your app in tomee/lib? Le 11 juin 2013 02:58, José Luis Cetina maxtorz...@gmail.com a écrit : Yes. Maven download always the lastest snapshot. El 10/06/2013 19:54, Howard W. Smith, Jr. smithh032...@gmail.com escribió: Latest TomEE 1.6.0-snapshot (trunk) ? On Mon, Jun 10, 2013 at 8:50 PM, José Luis Cetina maxtorz...@gmail.com wrote: CODI 1.5 and TomEE 1.6.0-Snapshot. :) El 10/06/2013 16:28, Howard W. Smith, Jr. smithh032...@gmail.com escribió: Interesting. Caused by: java.lang.IllegalStateException: no org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider in place! Please ensure that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compiled artifacts. If there is still a problem, try one of the controlled bootstrapping add-ons for the CDI implementation you are using. On Mon, Jun 10, 2013 at 5:22 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Jose, Interesting. I think i have plenty of (CDI) managed beans with public attributes, which are referenced by xhtml files and .java classes in my web app (WAR), but I don't have CODI dependency. What versions of CODI and TomEE are you using? Howard On Mon, Jun 10, 2013 at 2:02 PM, José Luis Cetina maxtorz...@gmail.com wrote: Just FYI, when you declare ( i did that by mistake) public attributes with their getter and setters in your ManagedBean you get this exception (by the way the error is not very documentated), looking at my code after 10 minutes i discover that my attributes was marked as public (by mistake) then i mark them as private and the error disappear. Log: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:561) at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:532) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:419) at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:370) at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73) at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:143) at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at
Re: versions
Is #edit supposed to do something? Everything looks the same to me. On Tue, Jun 11, 2013 at 8:12 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Right, if you are motivated to help us getting it you can edit the page ( http://tomee.apache.org/comparison.html#edit ) and add the spec versions, we'll then commit it to the main site *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi Romain these links only lists the acronyms, but don't provide the versions. For example, from glassfish documentation https://wikis.oracle.com/display/GlassFish/PlanForGlassFish4.0 JBOSS has the same https://docs.jboss.org/author/display/AS7/Getting+Started+Guide Weblogic too http://docs.oracle.com/cd/E24329_01/web.1211/e24494/toc.htm#CJADFEEG I think a page containing some reports from TomEE+ product management and some release notes would be great :-) [] Leo On Tue, Jun 11, 2013 at 8:45 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi you have some info here http://tomee.apache.org/downloads.html and more here http://tomee.apache.org/comparison.html *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi is there, somewhere, a table with each acronym version of tomEE+? I mean, tomEE+ 1.5.2 implements JSF 2.1, JMS x.x, JPA y.y... etc? TIA Leo
Re: CODI + TomEE + ManagedBean with public attributes
It's not possible to (work with attributes). In most CDI instances, you're working with a proxy. You cannot proxy a field, but you can proxy a method. On Tue, Jun 11, 2013 at 8:26 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: I do private attributes and public getter/setters. I think I copied some other people source code and they had public attributes, and I can't remember right now if I access the public attributes on those POJOs in any of my managed beans. On Jun 11, 2013 8:18 AM, John D. Ament john.d.am...@gmail.com wrote: Don't forget, most of these specs expect javabeans - POJOs w/ private fields getters/setters/issers. On Tue, Jun 11, 2013 at 12:54 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hmm, is it still a cdi bean then? I mean isnt there anything preventing it to be proxied or anything in the idea preventing it to be a cdi bean? Le 11 juin 2013 06:49, José Luis Cetina maxtorz...@gmail.com a écrit : Nop. If i just mark the fields as private the error goes away. El 10/06/2013 23:35, Romain Manni-Bucau rmannibu...@gmail.com escribió: Hi Didnt you put some part of your app in tomee/lib? Le 11 juin 2013 02:58, José Luis Cetina maxtorz...@gmail.com a écrit : Yes. Maven download always the lastest snapshot. El 10/06/2013 19:54, Howard W. Smith, Jr. smithh032...@gmail.com escribió: Latest TomEE 1.6.0-snapshot (trunk) ? On Mon, Jun 10, 2013 at 8:50 PM, José Luis Cetina maxtorz...@gmail.com wrote: CODI 1.5 and TomEE 1.6.0-Snapshot. :) El 10/06/2013 16:28, Howard W. Smith, Jr. smithh032...@gmail.com escribió: Interesting. Caused by: java.lang.IllegalStateException: no org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider in place! Please ensure that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compiled artifacts. If there is still a problem, try one of the controlled bootstrapping add-ons for the CDI implementation you are using. On Mon, Jun 10, 2013 at 5:22 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Jose, Interesting. I think i have plenty of (CDI) managed beans with public attributes, which are referenced by xhtml files and .java classes in my web app (WAR), but I don't have CODI dependency. What versions of CODI and TomEE are you using? Howard On Mon, Jun 10, 2013 at 2:02 PM, José Luis Cetina maxtorz...@gmail.com wrote: Just FYI, when you declare ( i did that by mistake) public attributes with their getter and setters in your ManagedBean you get this exception (by the way the error is not very documentated), looking at my code after 10 minutes i discover that my attributes was marked as public (by mistake) then i mark them as private and the error disappear. Log: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:561) at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:532) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:419) at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:370) at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73
Re: Struggling with JNDI lookup
And if you just lookup PooledDataSource (without prefix)? On Tue, Jun 11, 2013 at 8:13 AM, SPB spatri...@hotmail.com wrote: Hi, Using Tomcat Plus WebApp 1.5.2 running in Tomcat 7.0.27 In tomee.xml I have defined my Data Source: Resource id=PooledDataSource type=javax.sql.DataSource . /Resource JMX shows: Catalina - Resource - Global - org.apache.openejb.resource.jdbc.DataSourceFactory - PooledDataSource Code calls: // Tried lots of different values for this jndiPrefix majic: static final String jndiPrefix = java:global/; Context ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup(jndiPrefix + PooledDataSource); Connection connection = ds.getConnection(); Always gets naming.NameNotFoundException. What should the prefix be? Note, I have tried without prefix; also fails. -- View this message in context: http://openejb.979440.n4.nabble.com/Struggling-with-JNDI-lookup-tp4663626.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: versions
TomEE + is not a certified stack. TomEE is the Web Profile certified stack. TomEE + builds on that to add JAX-RS, JMS, JAX-WS etc. On Tue, Jun 11, 2013 at 8:40 AM, Leonardo K. Shikida shik...@gmail.comwrote: Hi Jean and Romain I'll try to help with the docs then. How TomEE+ got certified with JEE Web Profile? Is there a set of tests it must pass? [] Leo On Tue, Jun 11, 2013 at 9:32 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Jean-Louis MONTEIRO jeano...@gmail.com You can also help us in that sense Leonardo. We all fully agree that we need to pay attention to documentation, communication on so ... If you are interested in such a role, we would be more than happy. Contributors not only commit code, but also documentation, etc JLouis 2013/6/11 Romain Manni-Bucau rmannibu...@gmail.com #edit open a popup when you can after having given you apache id a form (maybe a browser isssue) @Leonardo: TomEE is an open source project living thanks to the contributions, if you assign somebody nothing ensure you he will do it. *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi Romain sure, I can spend some time contributing, but it's not a solution. I'd have to do this each new release. the solution is to assign someone to do some product management and plan for the new versions and make this planning public on the site [] Leo On Tue, Jun 11, 2013 at 9:12 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Right, if you are motivated to help us getting it you can edit the page ( http://tomee.apache.org/comparison.html#edit ) and add the spec versions, we'll then commit it to the main site *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi Romain these links only lists the acronyms, but don't provide the versions. For example, from glassfish documentation https://wikis.oracle.com/display/GlassFish/PlanForGlassFish4.0 JBOSS has the same https://docs.jboss.org/author/display/AS7/Getting+Started+Guide Weblogic too http://docs.oracle.com/cd/E24329_01/web.1211/e24494/toc.htm#CJADFEEG I think a page containing some reports from TomEE+ product management and some release notes would be great :-) [] Leo On Tue, Jun 11, 2013 at 8:45 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi you have some info here http://tomee.apache.org/downloads.htmland more here http://tomee.apache.org/comparison.html *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi is there, somewhere, a table with each acronym version of tomEE+? I mean, tomEE+ 1.5.2 implements JSF 2.1, JMS x.x, JPA y.y... etc? TIA Leo -- Jean-Louis
Re: versions
Right, but there is no rest profile. On Tue, Jun 11, 2013 at 9:13 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: TomEE JAXRS is certified BTW For that we passed Test Compatibility Kit (TCKs) provided by Oracle *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 John D. Ament john.d.am...@gmail.com TomEE + is not a certified stack. TomEE is the Web Profile certified stack. TomEE + builds on that to add JAX-RS, JMS, JAX-WS etc. On Tue, Jun 11, 2013 at 8:40 AM, Leonardo K. Shikida shik...@gmail.com wrote: Hi Jean and Romain I'll try to help with the docs then. How TomEE+ got certified with JEE Web Profile? Is there a set of tests it must pass? [] Leo On Tue, Jun 11, 2013 at 9:32 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Jean-Louis MONTEIRO jeano...@gmail.com You can also help us in that sense Leonardo. We all fully agree that we need to pay attention to documentation, communication on so ... If you are interested in such a role, we would be more than happy. Contributors not only commit code, but also documentation, etc JLouis 2013/6/11 Romain Manni-Bucau rmannibu...@gmail.com #edit open a popup when you can after having given you apache id a form (maybe a browser isssue) @Leonardo: TomEE is an open source project living thanks to the contributions, if you assign somebody nothing ensure you he will do it. *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi Romain sure, I can spend some time contributing, but it's not a solution. I'd have to do this each new release. the solution is to assign someone to do some product management and plan for the new versions and make this planning public on the site [] Leo On Tue, Jun 11, 2013 at 9:12 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Right, if you are motivated to help us getting it you can edit the page ( http://tomee.apache.org/comparison.html#edit ) and add the spec versions, we'll then commit it to the main site *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi Romain these links only lists the acronyms, but don't provide the versions. For example, from glassfish documentation https://wikis.oracle.com/display/GlassFish/PlanForGlassFish4.0 JBOSS has the same https://docs.jboss.org/author/display/AS7/Getting+Started+Guide Weblogic too http://docs.oracle.com/cd/E24329_01/web.1211/e24494/toc.htm#CJADFEEG I think a page containing some reports from TomEE+ product management and some release notes would be great :-) [] Leo On Tue, Jun 11, 2013 at 8:45 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi you have some info here http://tomee.apache.org/downloads.htmland more here http://tomee.apache.org/comparison.html *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau * *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/6/11 Leonardo K. Shikida shik...@gmail.com Hi
TomEE not supporting Validator injection
Hi all In section 3.6 of the CDI spec, it indicates that the Validator (javax.validation.Validator) should be a built in bean, meaning the container should support injection of it. I was testing something locally and i noticed that TomEE wasn't injecting this object. Is this expected? John
Re: Construct EJB from a separate JAR file
So, where is LoggerBuilder defined? same JAR or a different JAR? On Mon, Jun 10, 2013 at 9:15 AM, zeddius avalyu...@gmail.com wrote: Unfortunately this didn't help Is there any way how to put TomEE into a verbose mode to check why that bean is not visible? -- View this message in context: http://openejb.979440.n4.nabble.com/Construct-EJB-from-a-separate-JAR-file-tp4663583p4663589.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Examples missing code on website
They're in the code, probably excluded for brevity (not sure we care about a POJO w/ getters and setters). On Wed, Jun 5, 2013 at 7:45 PM, Jason Zwolak jzwo...@gmail.com wrote: It seems the examples are missing code on the website. Here's one case: http://tomee.apache.org/examples-trunk/rest-example/README.html The code for User, Post, UserDaoTest, etc. is missing. This seems to be the case for a number of examples. Is it supposed to be this way? -- Jason Zwolak
Re: JPA/Hibernate entity auto discovery
Andrew, Did you try using the setting exclude-unlisted-classes, with the value of false? John On Wed, Jun 5, 2013 at 8:27 PM, Andrew Clarke s...@clarke.ca wrote: I've set up my database in TomEE such that it works fine with SQL Query. When I attempted to do a simple entityManager.find() as a JPA test, I got the following error: java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: The bean encountered a non-application exception; nested exception is: java.lang.IllegalArgumentException: Unknown entity: com.example.account.Application I've gotten around this by adding classcom.example.account.Application/class to my persistence.xml file. However, in JBoss everything Just Works thanks to annotations and I don't need to use XML to set up my entities at all. On the one hand it's a bit of a bummer to add in all that XML but I can handle it if I have to. I'm experiencing some other issues though so I'm wondering if there's a bigger configuration problem that I should address. I've also tried using exclude-unlisted-classesfalse/exclude-unlisted-classes and property name=hibernate.archive.autodetection value=class / but neither of these seems to have made a difference for me. Because of the custom JNDI naming system in my code, and to keep things simple, I've been slowly adding in files into WEB-INF/classes/com/example. I could package them into WEB-INF/lib/example.jar but then I think I'd have to rewrite a LOT of JNDI naming, and my (limited) understanding is that it's not necessary to package the classes into a JAR for any reason. Here are some of my other files: persistence.xml: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider classcom.example.account.Application/class properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.hbm2ddl.auto value=update/ /properties /persistence-unit /persistence tomee.xml: ?xml version=1.0 encoding=UTF-8? tomee Resource id=example_db_prod type=DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/example_db_prod?autoReconnect=true UserName myusername Password mypassword validationQuery = SELECT 1 JtaManaged true /Resource /tomee Thank you very much for any help you can provide. It's a very steep learning curve trying to do this migration and I keep running into roadblock after roadblock. - Andrew.
Re: JPA/Hibernate entity auto discovery
Hmm yeah I missed that part. So wait, is your persistence.xml in your war file somewhere? Where is it? How do you get a reference to your entity manager? On Wed, Jun 5, 2013 at 8:39 PM, Andrew Clarke s...@clarke.ca wrote: Yes I did, thanks. I did mention that in the email, but I know there was a lot in there. This was the syntax of my persistence.xml when I tried that: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider exclude-unlisted-classesfalse/exclude-unlisted-classes properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.hbm2ddl.auto value=update/ /properties /persistence-unit /persistence - Andrew. On 2013-06-05, at 20:30, John D. Ament john.d.am...@gmail.com wrote: Andrew, Did you try using the setting exclude-unlisted-classes, with the value of false? John On Wed, Jun 5, 2013 at 8:27 PM, Andrew Clarke s...@clarke.ca wrote: I've set up my database in TomEE such that it works fine with SQL Query. When I attempted to do a simple entityManager.find() as a JPA test, I got the following error: java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: The bean encountered a non-application exception; nested exception is: java.lang.IllegalArgumentException: Unknown entity: com.example.account.Application I've gotten around this by adding classcom.example.account.Application/class to my persistence.xml file. However, in JBoss everything Just Works thanks to annotations and I don't need to use XML to set up my entities at all. On the one hand it's a bit of a bummer to add in all that XML but I can handle it if I have to. I'm experiencing some other issues though so I'm wondering if there's a bigger configuration problem that I should address. I've also tried using exclude-unlisted-classesfalse/exclude-unlisted-classes and property name=hibernate.archive.autodetection value=class / but neither of these seems to have made a difference for me. Because of the custom JNDI naming system in my code, and to keep things simple, I've been slowly adding in files into WEB-INF/classes/com/example. I could package them into WEB-INF/lib/example.jar but then I think I'd have to rewrite a LOT of JNDI naming, and my (limited) understanding is that it's not necessary to package the classes into a JAR for any reason. Here are some of my other files: persistence.xml: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider classcom.example.account.Application/class properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.hbm2ddl.auto value=update/ /properties /persistence-unit /persistence tomee.xml: ?xml version=1.0 encoding=UTF-8? tomee Resource id=example_db_prod type=DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/example_db_prod?autoReconnect=true UserName myusername Password mypassword validationQuery = SELECT 1 JtaManaged true /Resource /tomee Thank you very much for any help you can provide. It's a very steep learning curve trying to do this migration and I keep running into roadblock after roadblock. - Andrew.
Re: JPA/Hibernate entity auto discovery
So, the root META-INF? What happens when it goes in WEB-INF/classes/META-INF ? On Wed, Jun 5, 2013 at 9:29 PM, Andrew Clarke s...@clarke.ca wrote: Thanks again John. I'll include an example TestManagerBean.java below. My persistence.xml is in my WAR file under /META-INF. package com.example; import com.example.account.Application; import com.example.system.SystemPropertiesBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javax.ejb.EJB; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.persistence.*; @Stateless( name = TestManager ) @Local( TestManager.class ) @Remote( TestManagerRemote.class ) public class TestManagerBean implements TestManager { private static final Log logger = LogFactory.getLog(TestManagerBean.class); @EJB(beanName = AnotherEJBManager) private AnotherEJBManager anotherEJBManager; @EJB(beanName = SystemProperties) private SystemPropertiesBean systemProperties; @PersistenceContext(unitName = ExampleEngine) private EntityManager entityManager; @PersistenceUnit(unitName = ExampleEngine) private EntityManagerFactory entityManagerFactory; public String passItBack(String inOut) { logger.debug(TestManagerBean.inOut(' + inOut + ')); Application entity = entityManager.find(Application.class, 8f466445ab); logger.debug(Entity: + entity); return anotherEJBManager.passItBack(inOut); } } On 2013-06-05, at 20:43, John D. Ament john.d.am...@gmail.com wrote: Hmm yeah I missed that part. So wait, is your persistence.xml in your war file somewhere? Where is it? How do you get a reference to your entity manager? On Wed, Jun 5, 2013 at 8:39 PM, Andrew Clarke s...@clarke.ca wrote: Yes I did, thanks. I did mention that in the email, but I know there was a lot in there. This was the syntax of my persistence.xml when I tried that: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider exclude-unlisted-classesfalse/exclude-unlisted-classes properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.hbm2ddl.auto value=update/ /properties /persistence-unit /persistence - Andrew. On 2013-06-05, at 20:30, John D. Ament john.d.am...@gmail.com wrote: Andrew, Did you try using the setting exclude-unlisted-classes, with the value of false? John On Wed, Jun 5, 2013 at 8:27 PM, Andrew Clarke s...@clarke.ca wrote: I've set up my database in TomEE such that it works fine with SQL Query. When I attempted to do a simple entityManager.find() as a JPA test, I got the following error: java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: The bean encountered a non-application exception; nested exception is: java.lang.IllegalArgumentException: Unknown entity: com.example.account.Application I've gotten around this by adding classcom.example.account.Application/class to my persistence.xml file. However, in JBoss everything Just Works thanks to annotations and I don't need to use XML to set up my entities at all. On the one hand it's a bit of a bummer to add in all that XML but I can handle it if I have to. I'm experiencing some other issues though so I'm wondering if there's a bigger configuration problem that I should address. I've also tried using exclude-unlisted-classesfalse/exclude-unlisted-classes and property name=hibernate.archive.autodetection value=class / but neither of these seems to have made a difference for me. Because of the custom JNDI naming system in my code, and to keep things simple, I've been slowly adding in files into WEB-INF/classes/com/example. I could package them into WEB-INF/lib/example.jar but then I think I'd have to rewrite a LOT of JNDI naming, and my (limited) understanding is that it's not necessary to package the classes into a JAR for any reason. Here are some of my other files: persistence.xml: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider classcom.example.account.Application/class properties property name=hibernate.show_sql value=true/ property
Re: JPA/Hibernate entity auto discovery
Good catch, but AFAIK, Hibernate ignores the version of persistence.xml (typically). Unless TomEE cares... On Wed, Jun 5, 2013 at 9:39 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: responses inline below... On Wed, Jun 5, 2013 at 8:27 PM, Andrew Clarke s...@clarke.ca wrote: persistence.xml: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd; version=1.0 persistence-unit name=ExampleEngine providerorg.hibernate.ejb.HibernatePersistence/provider classcom.example.account.Application/class properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.hbm2ddl.auto value=update/ /properties /persistence-unit /persistence Interesting. According to your persistence.xml, you're using JPA 1.0 instead of JPA 2.0. When I started using TomEE+, I was instructed (or I had) to add jta-data-source and non-jta-data-source names to persistence.xml, but one of the later releases of TomEE+, it was no longer necessary to add non-jta-data-source name. See my persistence.xml below (yes, I'm using derby and not using hibernate). ?xml version=1.0 encoding=UTF-8? persistence version=2.0 xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; persistence-unit name=mcmsPU transaction-type=JTA providerorg.eclipse.persistence.jpa.PersistenceProvider/provider jta-data-sourcejdbc/mcmsJta/jta-data-source classjpa.entities.PaymentNotes/class classjpa.entities.Payment/class exclude-unlisted-classesfalse/exclude-unlisted-classes properties property name=eclipselink.target-database value=org.eclipse.persistence.platform.database.DerbyPlatform/ property name=eclipselink.jdbc.cache-statements value=true/ property name=eclipselink.jdbc.cache-statements.size value=128/ property name=eclipselink.logging.parameters value=false/ /properties /persistence-unit /persistence and below, I see you have 'JtaManaged true', which is all good, so I think it is necessary for you to add jta db name in your persistence.xml. tomee.xml: ?xml version=1.0 encoding=UTF-8? tomee Resource id=example_db_prod type=DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/example_db_prod?autoReconnect=true UserName myusername Password mypassword validationQuery = SELECT 1 JtaManaged true /Resource /tomee
Re: Eclipse timeout
Just like Romain noted SEVERE: FAIL ... LAI_Test_daInternetCompleto6:Missing required persistence.xml for @PersistenceContext ref em to unit On Tue, May 28, 2013 at 11:49 AM, Caterpillar caterpilla...@gmail.comwrote: 2013/5/28 Romain Manni-Bucau rmannibu...@gmail.com any procedure to reproduce it? Simply add a new server in Eclipse, and then try to start it. 2013/5/28 John D. Ament john.d.am...@gmail.com Can you post the entire stack trace that is in the console? Based on the rough output it's taking 111 s to start up. I increased the timeout to 150 and I had the same trouble. mag 28, 2013 5:43:38 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib mag 28, 2013 5:43:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:LAI_Test_daInternetCompleto6' did not find a matching property. mag 28, 2013 5:43:40 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler [http-bio-9080] mag 28, 2013 5:43:40 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler [ajp-bio-9009] mag 28, 2013 5:43:46 PM org.apache.openejb.util.OptionsLog info INFO: Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator' mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: OpenEJB http://openejb.apache.org/ mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: Startup: Tue May 28 17:43:46 CEST 2013 mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights Reserved. mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: Version: 4.5.2 mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: Build date: 20130320 mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: Build time: 03:56 mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: openejb.home = /home/username/Universita/Programmazione/apache-tomee-plus-1.5.2 mag 28, 2013 5:43:46 PM org.apache.openejb.OpenEJB$Instance init INFO: openejb.base = /home/username/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 mag 28, 2013 5:43:46 PM org.apache.openejb.cdi.CdiBuilder initializeOWB INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@6e48f457 mag 28, 2013 5:43:46 PM org.apache.openejb.cdi.CdiBuilder initializeOWB INFO: Succeeded in installing singleton service mag 28, 2013 5:43:46 PM org.apache.openejb.config.ConfigurationFactory init INFO: openejb configuration file is '/home/username/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/openejb.xml' mag 28, 2013 5:43:46 PM org.apache.openejb.util.OptionsLog info INFO: Using 'openejb.provider.default=org.apache.tomee' mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=My DataSource, type=Resource, provider-id=Default JDBC Database) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=My Unmanaged DataSource, type=Resource, provider-id=Default JDBC Database) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=My Singleton Container, type=Container, provider-id=Default Singleton Container) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=My Stateful Container, type=Container, provider-id=Default Stateful Container) mag 28, 2013 5:43:47 PM org.apache.openejb.config.ConfigurationFactory configureService INFO: Configuring Service(id=My Stateless Container, type=Container, provider-id=Default Stateless Container) mag 28, 2013 5:43:47 PM org.apache.openejb.config.DeploymentsResolver loadFrom WARNING: Deployments dir=null - Does not exist
Re: Abstract producer method cause UnsatisfiedResolutionException
The answer's in the spec (JSR-299) A producer method must be a non-abstract method of a managed bean class or session bean class. Your abstract class is neither a managed bean nor a session bean. I also confirmed that your project doesn't run with weld. On Mon, May 27, 2013 at 9:57 AM, Reinis Vicups to...@orbit-x.de wrote: Hello, I have three classes public abstract class AbstractFooProducer { protected void init(Foo foo) {} @Produces public Foo produceFoo() { Foo foo = new Foo(); init(foo); return foo; } } then public class ConcreteFooProducer extends AbstractFooProducer { @Override protected void init(Foo foo) { foo.setI(234); } } and @Typed(Object.class) public class Foo { ... } Foo is annotated with @Typed to avoid CDI directly injecting Foo in injection points. This cause following exception: javax.enterprise.inject.**UnsatisfiedResolutionException**: Api type [de.orbitx.specializes.Foo] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.**Default()] for injection into Field Injection Point, field name : foo, Bean Owner : [FooTest, Name:null, WebBeans Type:ENTERPRISE, API Types:[java.lang.Object,de.**orbitx.specializes.FooTest,**java.io.Serializable], Qualifiers:[javax.enterprise.**inject.Default,javax.** enterprise.inject.Any]] at org.apache.webbeans.util.**InjectionExceptionUtil.** throwUnsatisfiedResolutionExce**ption(InjectionExceptionUtil.**java:77) at org.apache.webbeans.container.**InjectionResolver.** checkInjectionPoints(**InjectionResolver.java:178) at org.apache.webbeans.container.**BeanManagerImpl.validate(** BeanManagerImpl.java:947) at org.apache.webbeans.config.**BeansDeployer.validate(** BeansDeployer.java:440) at org.apache.webbeans.config.**BeansDeployer.** validateInjectionPoints(**BeansDeployer.java:390) at org.apache.webbeans.config.**BeansDeployer.deploy(** BeansDeployer.java:194) at org.apache.openejb.cdi.**OpenEJBLifecycle.**startApplication(** OpenEJBLifecycle.java:182) at org.apache.openejb.cdi.**ThreadSingletonServiceImpl.**initialize(** ThreadSingletonServiceImpl.**java:158) at org.apache.openejb.cdi.**CdiBuilder.build(CdiBuilder.**java:43) at org.apache.openejb.assembler.**classic.Assembler.** createApplication(Assembler.**java:798) at org.apache.openejb.assembler.**classic.Assembler.** createApplication(Assembler.**java:612) at org.apache.openejb.assembler.**classic.Assembler.** createApplication(Assembler.**java:608) at org.apache.openejb.testing.**ApplicationComposers.before(** ApplicationComposers.java:580) at org.apache.openejb.testing.**ApplicationComposers.evaluate(** ApplicationComposers.java:664) at org.apache.openejb.junit.**ApplicationComposer$** DeployApplication.evaluate(**ApplicationComposer.java:64) at org.junit.runners.**ParentRunner.runLeaf(**ParentRunner.java:263) at org.junit.runners.**BlockJUnit4ClassRunner.**runChild(** BlockJUnit4ClassRunner.java:**68) at org.junit.runners.**BlockJUnit4ClassRunner.**runChild(** BlockJUnit4ClassRunner.java:**47) at org.junit.runners.**ParentRunner$3.run(**ParentRunner.java:231) at org.junit.runners.**ParentRunner$1.schedule(**ParentRunner.java:60) at org.junit.runners.**ParentRunner.runChildren(** ParentRunner.java:229) at org.junit.runners.**ParentRunner.access$000(**ParentRunner.java:50) at org.junit.runners.**ParentRunner$2.evaluate(** ParentRunner.java:222) at org.junit.runners.**ParentRunner.run(ParentRunner.**java:300) at org.eclipse.jdt.internal.**junit4.runner.**JUnit4TestReference.run( **JUnit4TestReference.java:50) at org.eclipse.jdt.internal.**junit.runner.TestExecution.** run(TestExecution.java:38) at org.eclipse.jdt.internal.**junit.runner.RemoteTestRunner.** runTests(RemoteTestRunner.**java:467) at org.eclipse.jdt.internal.**junit.runner.RemoteTestRunner.** runTests(RemoteTestRunner.**java:683) at org.eclipse.jdt.internal.**junit.runner.RemoteTestRunner.** run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.**junit.runner.RemoteTestRunner.** main(RemoteTestRunner.java:**197) Why is AbstractFooProducer#**produceFoo() not seen by CDI? I am also attaching a test project Thank you very much for your hints Reinis.
Re: Remote/Managed TomEE Arquillian
Hi Anyone else running Windows 7 pro? I tried on two different machines and ran into issues with it trying to bind to port 8080. it didn't reproduce for me on Fedora 18. I confirmed no other service was trying to listen on that port as well. John On Wed, May 22, 2013 at 7:58 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: you have it in Source tab of this jira: https://issues.apache.org/jira/browse/TOMEE-835?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/5/22 John D. Ament john.d.am...@gmail.com Yes, everything works fine in 1.5.1 Can you point me to the change (svn commit)? On Wed, May 22, 2013 at 12:39 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi Did you try the adapter with the version 1.5.1? 1.5.2 has only a single work on arquillian adapters compared to 1.5.1 which makes them hard to configure compared to previous version (and only useful for our build i guess). Le 22 mai 2013 04:46, John D. Ament john.d.am...@gmail.com a écrit : Hi All I'm testing something locally and I noticed that for TomEE 1.5.2 it doesn't seem to be starting automatically. This is the dependency: dependency groupIdorg.apache.openejb/groupId artifactIdtomee-embedded/artifactId version${tomee.version}/version /dependency And variable: tomee.version1.5.2/tomee.version John
Re: [OWB] make @Specializes to work for me
Perhaps if you shared the stacktrace it would be easier to decipher what's going on. On Wed, May 22, 2013 at 6:42 AM, to...@orbit-x.de wrote: Hi guys, excuse me for bumping my own message but two days later am still clueless. Could it possibly be that i may not @Specializes an abstract class? thx for your help! Reinis -Ursprüngliche Nachricht- Betreff: [OWB] make @Specializes to work for me Von: to...@orbit-x.de An: users@tomee.apache.org Datum: 2013/05/20 11:42:34 Hi guys, in my scenario I want to realize a template method. For this I implement common abstract base class: public abstract AbstractFooProducer { protected void init() {} @Produces public Foo produceFoo() { init(); return foo; } and then one or more specific implementations: public class XmlFooProducer extends AbstractFooProducer { @Override protected void init() { // wicked xml initialization done here } } Now, this solution is causing me some headache to realize, here are number of wrong assumptions I made: - I assumed that, because AbstractFooProducer is abstract, OWB will activate XmlFooProducer as the only concrete implementation and will recognize @Produces method through the inheritance. No, does not happen! - Ok, next assumption is that if I decorate XmlFooProducer with @Specializes I will get the behavior described above. No and from this point on i always get this same exception from OWB: InconsistentSpecializationException(not sure if the name is correct since am writing this by heart but it is thrown by OWBBeanUtil during configureSpecializations()); - Next, I will add @Alternative on top of @Specializes and activate it to make it work (as described in oracle docs for CDI). Result - the said InconsistentSpecializationException; - Next, I will @Override the @Produces method from abstract class in the concrete implementation (i read some place that specializing class fully replaces specialized class and interpreted this so that i have to replicate then all relevant Cdi annotations). No, the same exception is thrown; At this point i am out of ideas and would appretiate a hint or two on how to make it work. br Reinis
Re: Remote/Managed TomEE Arquillian
Yes, everything works fine in 1.5.1 Can you point me to the change (svn commit)? On Wed, May 22, 2013 at 12:39 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hi Did you try the adapter with the version 1.5.1? 1.5.2 has only a single work on arquillian adapters compared to 1.5.1 which makes them hard to configure compared to previous version (and only useful for our build i guess). Le 22 mai 2013 04:46, John D. Ament john.d.am...@gmail.com a écrit : Hi All I'm testing something locally and I noticed that for TomEE 1.5.2 it doesn't seem to be starting automatically. This is the dependency: dependency groupIdorg.apache.openejb/groupId artifactIdtomee-embedded/artifactId version${tomee.version}/version /dependency And variable: tomee.version1.5.2/tomee.version John
Re: form-login-page wrong redirect
Did you try swapping your form-login-page and form-error-page from /foo.xhtml to /foo.jsf ? (or whatever you map the faces servlet to) On Tue, May 21, 2013 at 1:08 PM, José Luis Cetina maxtorz...@gmail.comwrote: Hi. I have a problem since i move from war to ear (since 4 months ago aprox.), but i didn't have any chance to report it. I have a security constraint with a based-form login, i have defined my form-login-page to an xhtml let say a login.xhtml, but when somebody tries to access to private content without be login, the redirect of the form-login-page is wrong, i mean tomee try to redirect to http://login.xhtmlinstead of http://myexampleurl.com/login.xhtml Here is the part of my web.xml security-constraint display-namePRIVATE_CONTENT_CONSTRAINT/display-name web-resource-collection web-resource-namePRIVATE_CONTENT_CONSTRAINT/web-resource-name url-pattern/private/*/url-pattern /web-resource-collection auth-constraint description/ role-nametomee-admin/role-name role-namemanager-gui/role-name role-namemanager-script/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/index.xhtml/form-login-page form-error-page/index.xhtml/form-error-page /form-login-config /login-config I could reproduce this behavior easily in this github project https://github.com/maxtorzito/tomee For use, clean and install from parent project pom.xml, then tomee run from ear's pom.xml then access to mymailing2.com:8080 (dont forget to add this in your /etc/hosts) then you will see 1 link and 2 buttons. First try to access to the private content using the link (a href) you will see what i report here, tomee tries to redirect the relative path like absolute path. If you login an then try to access to the private content everything is fine. The problem is just the redirect. The github project run with tomee plugin, you only have to add the host to your hosts file. After this i will report, in other thread a CODI issue using @InitView annotation.
Re: form-login-page wrong redirect
Interesting. Are your underlying files also *.xhtml ? On Tue, May 21, 2013 at 1:14 PM, José Luis Cetina maxtorz...@gmail.comwrote: I will try now, but i have this mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.xhtml/url-pattern /servlet-mapping 2013/5/21 John D. Ament john.d.am...@gmail.com Did you try swapping your form-login-page and form-error-page from /foo.xhtml to /foo.jsf ? (or whatever you map the faces servlet to) On Tue, May 21, 2013 at 1:08 PM, José Luis Cetina maxtorz...@gmail.com wrote: Hi. I have a problem since i move from war to ear (since 4 months ago aprox.), but i didn't have any chance to report it. I have a security constraint with a based-form login, i have defined my form-login-page to an xhtml let say a login.xhtml, but when somebody tries to access to private content without be login, the redirect of the form-login-page is wrong, i mean tomee try to redirect to http://login.xhtmlinstead of http://myexampleurl.com/login.xhtml Here is the part of my web.xml security-constraint display-namePRIVATE_CONTENT_CONSTRAINT/display-name web-resource-collection web-resource-namePRIVATE_CONTENT_CONSTRAINT/web-resource-name url-pattern/private/*/url-pattern /web-resource-collection auth-constraint description/ role-nametomee-admin/role-name role-namemanager-gui/role-name role-namemanager-script/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/index.xhtml/form-login-page form-error-page/index.xhtml/form-error-page /form-login-config /login-config I could reproduce this behavior easily in this github project https://github.com/maxtorzito/tomee For use, clean and install from parent project pom.xml, then tomee run from ear's pom.xml then access to mymailing2.com:8080 (dont forget to add this in your /etc/hosts) then you will see 1 link and 2 buttons. First try to access to the private content using the link (a href) you will see what i report here, tomee tries to redirect the relative path like absolute path. If you login an then try to access to the private content everything is fine. The problem is just the redirect. The github project run with tomee plugin, you only have to add the host to your hosts file. After this i will report, in other thread a CODI issue using @InitView annotation. -- --- *SCJA. José Luis Cetina* ---
Remote/Managed TomEE Arquillian
Hi All I'm testing something locally and I noticed that for TomEE 1.5.2 it doesn't seem to be starting automatically. This is the dependency: dependency groupIdorg.apache.openejb/groupId artifactIdtomee-embedded/artifactId version${tomee.version}/version /dependency And variable: tomee.version1.5.2/tomee.version John
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
Howard, When were you recommended to use @Typed? @Typed (in that thread) was being used to *remove* objects from being installed via CDI. If you want to use @Typed you need to use it as @Typed(pf_ OrderCustomerPointOfContactController.class) On Mon, May 20, 2013 at 9:08 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Okay, I've seen the recent OWB (or CDI) topics, so I thought I might introduce a separate thread based on my experience today. Months ago, I migrated from JSF managed beans to CDI manageds (and migrated from Glassfish to TomEE/OpenWebBeans), two birds with one stone. During that migration, I created the following for descendant managed beans in my app. @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface Descendant {} which allowed me to implement the following ancestor class (for example): @Default @Named(pf_addressController) @SessionScoped public class pf_AddressController implements Serializable { and develop descendants, which extend the ancestor as follows (for example): @Descendant @Named(pf_hotelAddressController) @SessionScoped public class pf_HotelAddressController extends pf_AddressController { also, I was able to add the following to one of my pf_OrdersController (which has 'no' descendant classes) @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; Everything mentioned above has worked in production ever since I started using TomEE (almost 6 months ago). Today, it was suggested that I use @Typed instead of this user-defined @Descendant. @Typed seems to work well on/for extending managed bean ancestors, but I replaced @Descendant (in the code above) with @Typed as seen below (for bean 'member'): @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; and now, TomEE will not start, because of the following error: INFO: Adding OpenWebBeansPlugin : [CdiPlugin] May 20, 2013 8:42:34 AM org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] May 20, 2013 8:42:36 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [jsf.orderCustomerPointOfContact.pf_OrderCustomerPointOfContactController] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : orderCustomerPointOfContactController, Bean Owner : [pf_OrdersController, Name:pf_ordersController, WebBeans Type:MANAGED, API Types:[java.io.Serializable,java.lang.Object,jsf.orders.pf_OrdersController], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:77) at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:238) at org.apache.webbeans.util.WebBeansUtil.isPassivationCapableDependency(WebBeansUtil.java:1573) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:170) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapable(DeploymentValidationService.java:127) at org.apache.webbeans.config.BeansDeployer.checkPassivationScope(BeansDeployer.java:748) at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:428) at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:390) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:194) at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:182) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:158) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:793) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:608) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:974) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
Care to link to it, so we all have a frame of reference? I don't immediately see it on their forums. On Mon, May 20, 2013 at 9:15 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: There was a separate thread in PrimeFaces forum, where I was suggested to use @Typed instead of my user-defined @Descendant. :) I will try @Typed as you recommended and report back, ASAP. Thanks. On Mon, May 20, 2013 at 9:13 AM, John D. Ament john.d.am...@gmail.com wrote: Howard, When were you recommended to use @Typed? @Typed (in that thread) was being used to *remove* objects from being installed via CDI. If you want to use @Typed you need to use it as @Typed(pf_ OrderCustomerPointOfContactController.class) On Mon, May 20, 2013 at 9:08 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Okay, I've seen the recent OWB (or CDI) topics, so I thought I might introduce a separate thread based on my experience today. Months ago, I migrated from JSF managed beans to CDI manageds (and migrated from Glassfish to TomEE/OpenWebBeans), two birds with one stone. During that migration, I created the following for descendant managed beans in my app. @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface Descendant {} which allowed me to implement the following ancestor class (for example): @Default @Named(pf_addressController) @SessionScoped public class pf_AddressController implements Serializable { and develop descendants, which extend the ancestor as follows (for example): @Descendant @Named(pf_hotelAddressController) @SessionScoped public class pf_HotelAddressController extends pf_AddressController { also, I was able to add the following to one of my pf_OrdersController (which has 'no' descendant classes) @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; Everything mentioned above has worked in production ever since I started using TomEE (almost 6 months ago). Today, it was suggested that I use @Typed instead of this user-defined @Descendant. @Typed seems to work well on/for extending managed bean ancestors, but I replaced @Descendant (in the code above) with @Typed as seen below (for bean 'member'): @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; and now, TomEE will not start, because of the following error: INFO: Adding OpenWebBeansPlugin : [CdiPlugin] May 20, 2013 8:42:34 AM org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] May 20, 2013 8:42:36 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [jsf.orderCustomerPointOfContact.pf_OrderCustomerPointOfContactController] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : orderCustomerPointOfContactController, Bean Owner : [pf_OrdersController, Name:pf_ordersController, WebBeans Type:MANAGED, API Types:[java.io.Serializable,java.lang.Object,jsf.orders.pf_OrdersController], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:77) at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:238) at org.apache.webbeans.util.WebBeansUtil.isPassivationCapableDependency(WebBeansUtil.java:1573) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:170) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapable(DeploymentValidationService.java:127) at org.apache.webbeans.config.BeansDeployer.checkPassivationScope(BeansDeployer.java:748) at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:428) at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:390) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:194) at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:182) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:158) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:793) at org.apache.openejb.assembler.classic.Assembler.createApplication
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
Just because another developer tells you they don't know what your qualifier means, doesn't mean they are right :-) I would recommend that you switch off of @Typed, it's not what you're looking for. @Named should correctly identify your specific bean. As long as you are never referencing the underlying class expecting the impl you should be fine. On Mon, May 20, 2013 at 9:19 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Start here[1] and go to the next page. [1] http://forum.primefaces.org/viewtopic.php?f=3t=30309#p97538 On Mon, May 20, 2013 at 9:17 AM, John D. Ament john.d.am...@gmail.com wrote: Care to link to it, so we all have a frame of reference? I don't immediately see it on their forums. On Mon, May 20, 2013 at 9:15 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: There was a separate thread in PrimeFaces forum, where I was suggested to use @Typed instead of my user-defined @Descendant. :) I will try @Typed as you recommended and report back, ASAP. Thanks. On Mon, May 20, 2013 at 9:13 AM, John D. Ament john.d.am...@gmail.com wrote: Howard, When were you recommended to use @Typed? @Typed (in that thread) was being used to *remove* objects from being installed via CDI. If you want to use @Typed you need to use it as @Typed(pf_ OrderCustomerPointOfContactController.class) On Mon, May 20, 2013 at 9:08 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Okay, I've seen the recent OWB (or CDI) topics, so I thought I might introduce a separate thread based on my experience today. Months ago, I migrated from JSF managed beans to CDI manageds (and migrated from Glassfish to TomEE/OpenWebBeans), two birds with one stone. During that migration, I created the following for descendant managed beans in my app. @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface Descendant {} which allowed me to implement the following ancestor class (for example): @Default @Named(pf_addressController) @SessionScoped public class pf_AddressController implements Serializable { and develop descendants, which extend the ancestor as follows (for example): @Descendant @Named(pf_hotelAddressController) @SessionScoped public class pf_HotelAddressController extends pf_AddressController { also, I was able to add the following to one of my pf_OrdersController (which has 'no' descendant classes) @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; Everything mentioned above has worked in production ever since I started using TomEE (almost 6 months ago). Today, it was suggested that I use @Typed instead of this user-defined @Descendant. @Typed seems to work well on/for extending managed bean ancestors, but I replaced @Descendant (in the code above) with @Typed as seen below (for bean 'member'): @Inject @Descendant private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; and now, TomEE will not start, because of the following error: INFO: Adding OpenWebBeansPlugin : [CdiPlugin] May 20, 2013 8:42:34 AM org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] May 20, 2013 8:42:36 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [jsf.orderCustomerPointOfContact.pf_OrderCustomerPointOfContactController] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : orderCustomerPointOfContactController, Bean Owner : [pf_OrdersController, Name:pf_ordersController, WebBeans Type:MANAGED, API Types:[java.io.Serializable,java.lang.Object,jsf.orders.pf_OrdersController], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:77) at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:238) at org.apache.webbeans.util.WebBeansUtil.isPassivationCapableDependency(WebBeansUtil.java:1573) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:170
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
@Typed isn't a qualifier. It goes on the class definition, not on the injection point. @Typed(pf_OrderCustomerPointOfContactController.class) public class pf_OrderCustomerPointOfContactController extends WhateverBaseClass { .. } On Mon, May 20, 2013 at 9:23 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: As you suggested, I just added/modified the code, so the code now is as follows: @Inject @Typed(pf_OrderCustomerPointOfContactController.class) private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; which still results in the following (which prevents OWB starting): SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [jsf.orderCustomerPointOfContact.pf_OrderCustomerPointOfContactController] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : orderCustomerPointOfContactController, Bean Owner : [pf_OrdersController, Name:pf_ordersController, WebBeans Type:MANAGED, API Types:[java.io.Serializable,java.lang.Object,jsf.orders.pf_OrdersController], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:77) at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:238) at org.apache.webbeans.util.WebBeansUtil.isPassivationCapableDependency(WebBeansUtil.java:1573) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:170) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapable(DeploymentValidationService.java:127) at org.apache.webbeans.config.BeansDeployer.checkPassivationScope(BeansDeployer.java:748) at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:428) at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:390) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:194) at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:182) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:158) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:793) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:608) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:974) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1654) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) On Mon, May 20, 2013 at 9:15 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: There was a separate thread in PrimeFaces forum, where I was suggested to use @Typed instead of my user-defined @Descendant. :) I will try @Typed as you recommended and report back, ASAP. Thanks. On Mon, May 20, 2013 at 9:13 AM, John D. Ament john.d.am...@gmail.com wrote: Howard, When were you recommended to use @Typed? @Typed (in that thread) was being used to *remove* objects from being installed via CDI. If you want to use @Typed you need to use it as @Typed(pf_ OrderCustomerPointOfContactController.class) On Mon, May 20, 2013 at 9:08 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Okay, I've seen the recent OWB (or CDI) topics, so I thought I might introduce a separate thread based on my experience today. Months ago, I migrated from JSF
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
When you do this.. @Typed @Named(pf_orderCustomerPointOfContactController) @SessionScoped public class pf_OrderCustomerPointOfContactController extends pf_PointOfContactController { The injection point should be @Inject @Named(pf_orderCustomerPointOfContactController) private Object obj; The reason is that you don't specify any classes in @Typed so it can't be referenced as any type (other than Object). I'm still strongly favoring that you ignore what the primefaces guy said. John On Mon, May 20, 2013 at 9:37 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Okay, that is what I was doing wrong. maybe, just before you clicked the Send button and sent your last response (below), I thought about checking the class definition. Here is the class definition below. @Typed @Named(pf_orderCustomerPointOfContactController) @SessionScoped public class pf_OrderCustomerPointOfContactController extends pf_PointOfContactController { So, evidently, my bean-member definition was incorrect, so I have corrected it as follows, @Inject private pf_OrderCustomerPointOfContactController orderCustomerPointOfContactController; This bean member is referenced by another/primary bean class called pf_OrdersController. After removing '@Typed...' from the injected bean member, I still get the following error: May 20, 2013 9:32:43 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [jsf.orderCustomerPointOfContact.pf_OrderCustomerPointOfContactController] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : orderCustomerPointOfContactController, Bean Owner : [pf_OrdersController, Name:pf_ordersController, WebBeans Type:MANAGED, API Types:[java.lang.Object,jsf.orders.pf_OrdersController,java.io.Serializable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:77) at org.apache.webbeans.container.InjectionResolver.getInjectionPointBean(InjectionResolver.java:238) at org.apache.webbeans.util.WebBeansUtil.isPassivationCapableDependency(WebBeansUtil.java:1573) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:170) at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapable(DeploymentValidationService.java:127) at org.apache.webbeans.config.BeansDeployer.checkPassivationScope(BeansDeployer.java:748) at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:428) at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:390) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:194) at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:182) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:158) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:793) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:608) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:974) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1654) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) On Mon, May 20, 2013 at 9:26 AM, John D. Ament john.d.am...@gmail.com wrote: @Typed isn't a qualifier
Re: TomEE/CDI: adding @Typed resulted in UnsatisfiedResolutionException
You get these errors in NetBeans or in TomEE? Or both? On Mon, May 20, 2013 at 10:06 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: responses inline, below... On Mon, May 20, 2013 at 9:41 AM, John D. Ament john.d.am...@gmail.com wrote: When you do this.. @Typed @Named(pf_orderCustomerPointOfContactController) @SessionScoped public class pf_OrderCustomerPointOfContactController extends pf_PointOfContactController { The injection point should be @Inject @Named(pf_orderCustomerPointOfContactController) private Object obj; wow, when I do all (verbatim) as you mentioned above, I get a boatload of erors in NetBeans, since I did the following, @Inject @Named(pf_orderCustomerPointOfContactController) private Object orderCustomerPointOfContactController; and orderCustomerPointOfContactController is referenced many times in pf_OrdersController. pf_orderCustomerPointOfContactController (actually, pf_PointOfContactController) has many methods which is referenced via orderCustomerPointOfContactController. Going forward, I will revert to using @Descendant 'only' on the class (and the injected bean member), but I wanted to report that the suggested @Type is working on all the other beans that were once marked with @Descendant. Thanks John for the responses!
Re: stand alone Application looks up remote EJB by global jndi name
No Good? On Sun, May 19, 2013 at 7:18 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: What does mean NG? Le 19 mai 2013 13:16, ZhongGuan guanzh.em...@gmail.com a écrit : And I also have tested other cases of EJB JNDI name on 1.6.0 Here is the result 1. Local EJB Client looks up @Local EJB global jndi name is OK mappedname is NG 2 remote EJB Client looks up @Remote EJB global jndi name is NG mappedname is OK -- View this message in context: http://openejb.979440.n4.nabble.com/stand-alone-Application-looks-up-remote-EJB-by-global-jndi-name-tp4663033p4663049.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: [OWB] CDI - how to realize default producer?
Well, I think @Typed is another work around. It doesn't remove the object from the archive simply says you can't reference it by anything but what's in @Typed. On Sun, May 19, 2013 at 6:19 AM, Mark Struberg strub...@yahoo.de wrote: CDI-1.0 _has_ a concept of vetoing. Simply annotate Foo with @Typed() LieGrue, strub - Original Message - From: John D. Ament john.d.am...@gmail.com To: users@tomee.apache.org Cc: Sent: Sunday, 19 May 2013, 4:37 Subject: Re: [OWB] CDI - how to realize default producer? T he easiest way is to actually put a qualifier on the class itself, and then never inject based on that qualifier. CDI 1.0 has no concept of a veto'd bean, but you could write an extension yourself that veto'd your class. Extensions exist out there, I believe CODI has one and Seam3 has one. Seam3 uses @Veto to mark these beans as veto'd. On Sat, May 18, 2013 at 6:48 PM, Reinis Vicups to...@orbit-x.de wrote: Hi, I'd like to use a producer method in ALL CASES when @Injecting a particular bean. It looks like this: public class FooProducer { @Produces public Foo produceFoo() { Foo foo = new Foo(); return foo; } } public class Foo {} With this example I get: SEVERE - CDI Beans module deployment failed javax.enterprise.inject.**AmbiguousResolutionException: Ambiguous resolution found beans: Foo, Name:null, WebBeans Type:MANAGED, API Types:[Foo,java.lang.**Object], Qualifiers:[javax.enterprise.**inject.Any,javax.enterprise.** inject.Default] Foo, Name:null, WebBeans Type:PRODUCERMETHOD, API Types:[Foo,java.lang. **Object], Qualifiers:[javax.enterprise.**inject.Any,javax.enterprise.** inject.Default] I tried applying @Default with no success. And I don't want to make specific @Qualifier annotation, because this is unnecessary in my case and will cause errors in those cases when I forget to provide that @Qualifier at injection point. If anyone could help me with setting up a correct way to provide default producer, would be great. thanks and kind regards Reinis
Re: stand alone Application looks up remote EJB by global jndi name
According to http://docs.oracle.com/javaee/6/api/javax/ejb/EJB.html lookup should be the portable. MappedName is the product specific. On Sun, May 19, 2013 at 8:59 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Hehe, ok (i use NOk ;) Btw mapped names are not portable IIRC so it is not an issue no? Le 19 mai 2013 14:12, John D. Ament john.d.am...@gmail.com a écrit : No Good? On Sun, May 19, 2013 at 7:18 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: What does mean NG? Le 19 mai 2013 13:16, ZhongGuan guanzh.em...@gmail.com a écrit : And I also have tested other cases of EJB JNDI name on 1.6.0 Here is the result 1. Local EJB Client looks up @Local EJB global jndi name is OK mappedname is NG 2 remote EJB Client looks up @Remote EJB global jndi name is NG mappedname is OK -- View this message in context: http://openejb.979440.n4.nabble.com/stand-alone-Application-looks-up-remote-EJB-by-global-jndi-name-tp4663033p4663049.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: [OWB] CDI - how to realize default producer?
The easiest way is to actually put a qualifier on the class itself, and then never inject based on that qualifier. CDI 1.0 has no concept of a veto'd bean, but you could write an extension yourself that veto'd your class. Extensions exist out there, I believe CODI has one and Seam3 has one. Seam3 uses @Veto to mark these beans as veto'd. On Sat, May 18, 2013 at 6:48 PM, Reinis Vicups to...@orbit-x.de wrote: Hi, I'd like to use a producer method in ALL CASES when @Injecting a particular bean. It looks like this: public class FooProducer { @Produces public Foo produceFoo() { Foo foo = new Foo(); return foo; } } public class Foo {} With this example I get: SEVERE - CDI Beans module deployment failed javax.enterprise.inject.**AmbiguousResolutionException: Ambiguous resolution found beans: Foo, Name:null, WebBeans Type:MANAGED, API Types:[Foo,java.lang.**Object], Qualifiers:[javax.enterprise.**inject.Any,javax.enterprise.** inject.Default] Foo, Name:null, WebBeans Type:PRODUCERMETHOD, API Types:[Foo,java.lang. **Object], Qualifiers:[javax.enterprise.**inject.Any,javax.enterprise.** inject.Default] I tried applying @Default with no success. And I don't want to make specific @Qualifier annotation, because this is unnecessary in my case and will cause errors in those cases when I forget to provide that @Qualifier at injection point. If anyone could help me with setting up a correct way to provide default producer, would be great. thanks and kind regards Reinis
Re: EJBContainer No provider definition found
Just to have a little better context, you want to go from your local tomee instance to a remote OpenEJB instance running in a separate JVM? On Fri, May 17, 2013 at 7:08 AM, Caroline caroline.van.den.ha...@gmail.comwrote: Hi, Romain already helped me tremendously on http://openejb.979440.n4.nabble.com/Location-of-jar-bean-so-it-s-seen-by-CDI-td4662777.html . I tried to have CDI look for newly added .jars after deployment. I understand now that's not what CDI does. However, I need to build in this scanning for .jars anyways, using other JEE techniques such as EJB. I'm _very_ short in time and I'm struggling. I hope someone can help. I have a WebService that is called from a PhoneGap client: @Path(request) @RequestScoped public class RequestResource { @Context private UriInfo context; public RequestResource() { } @POST @Path(post) @Consumes(application/json) public Response postJson(String content) { AreeConfiguration config = codeThatMakesConfig(); config.refreshEJB(); (code that makes output) return Response.status(201).entity(output.toString()).build(); } } and my AreeConfiguration class in which I'm now just trying to get past Exceptions but where I - eventually - will want to load all implementations of AreeInput I can get from either within the webapplication or .jars (or other bundles) in a folder somewhere on the TomEE server: @Default public class AreeConfiguration { public AreeConfiguration(){ } public void refreshEJB() throws NamingException{ System.out.println(Server: going the EJB route); Properties properties = new Properties(); properties.setProperty(openejb.embedded.remotable, true); properties.setProperty(openejb.validation.output.level , medium); Context ctx = EJBContainer.createEJBContainer(properties).getContext(); //javax.ejb.EJBException: Provider error. No provider definition found happens above this line. System.out.println(ctx.getNameInNamespace()); } } I've been through http://openejb.979440.n4.nabble.com/ejb-from-ws-td4470387.html and both TomEE examples as well as the example Romain gives work in newly created projects. I'm using TomEE+ 1.6.0-SNAPSHOT from May 13. I have the following (amongst other things) in my pom.xml: dependency groupIdorg.apache.openejb/groupId artifactIdjavaee-api/artifactId version6.0-4/version /dependency dependency groupIdorg.apache.openejb/groupId artifactIdtomee-embedded/artifactId version1.0.0/version scopetest/scope /dependency dependency groupIdjavax/groupId artifactIdjavaee-api/artifactId version6.0/version scopeprovided/scope /dependency pluginRepositories pluginRepository idapache.snapshots/id urlhttp://repository.apache.org/snapshots//url /pluginRepository /pluginRepositories Thanks so much. -- View this message in context: http://openejb.979440.n4.nabble.com/EJBContainer-No-provider-definition-found-tp4663028.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: ear/lib not seen ? I'm getting a class not found error...
CAn you post the stacktrace? On Fri, May 10, 2013 at 5:30 PM, m1000 martinmil...@gmail.com wrote: Hi, I'm a new user of Tomee (1.5.2). I am also kind of a newbie to J2EE. Still what I got was working under Glassfish. Now I am trying to get it working under Tomee... My EJB Timer successfully work on calling my method, but I get a Class not found exception when that code try to access classes that are in jar files in my .ear/lib/ directory. I don't understand why, /lib should be in the classpath automatically ? Here is my structure : lib/ -- many of my own jar files in there META-INF/ ejb.jar ?xml version=1.0 encoding=UTF-8? application xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd; version=6 module id=PlanningAndControlServer4-EJB ejbejb.jar/ejb /module library-directorylib/library-directory /application I've added the library-directory tag even if it should not be needed, but still the same... -- View this message in context: http://openejb.979440.n4.nabble.com/ear-lib-not-seen-I-m-getting-a-class-not-found-error-tp4662819.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to change CXF JSON output format?
Can you post your entire POJO? On Thu, May 2, 2013 at 7:25 AM, Jack Anamanda jack.anama...@rocketmail.comwrote: Hi guys. When I return an @XmlRootElement object in a JAX-RS method, I get the following format for properties of type long : width : { $ : 32, @xsi.type : xs:int } How can I change this, so that I just get the following: width : 32, I'm on TomEE 1.5.2 with the JAX-RS profile. Thanks. -- View this message in context: http://openejb.979440.n4.nabble.com/How-to-change-CXF-JSON-output-format-tp4662646.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: SocialAuth CDI not working on TomEE
Try injecting it this way: @Inject @Named(socialAuth) private SocialAuth socialAuth; On Wed, Apr 24, 2013 at 1:47 PM, Luca Merolla luca.mero...@gmail.comwrote: H ello everyone, I'm having problem to make socialauth ( https://code.google.com/p/socialauth/) work in TomEE. I'm using the CDI library and I run into an error like this: SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [org.brickred.socialauth.cdi.SocialAuth] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field name : socialauth, Bean Owner : [UpdateStatus, Name:socialAuthUpdateStatus, WebBeans Type:MANAGED, API Types:[org.test.UpdateStatus,java.io.Serializable,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]] at org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:77) I have tried to deploy it both within an EAR folder or as a WAR inside webapps. I have also tried with TomEE 1.5.1 and the latest 1.5.2. The latest version is giving the exception while deploying, while 1.5.1 is silent even though it doesn't work either. I have made a very basic sample project to test the issue. Here is the war file: http://www.fileconvoy.com/dfl.php?id=g902f5fea97a4c54099927386418af3485c0388d5d And here I have uploaded the source code: https://gist.github.com/lucamerolla/5453991 I haven't tested it yet in 1.6.0-SNAPSHOT but maybe I'm missing something to run in 1.5.x Thanks in advance, LM
Re: Re[2]: JPA issue in combo with @SessionScoped
The alternative is to just inject the EJB and call the method directly here. On Mon, Apr 15, 2013 at 8:14 AM, to...@orbit-x.de wrote: Hi Romain, thanks, I already guessed something like this. But is there some pattern to avoid this or work around or something I could use to make it work? Basically it means I may not use any cdi on jpa entities whatsoever and that is quite a constraint :) kind regards Reinis -Original-Nachricht- Von: Romain Manni-Bucau rmannibu...@gmail.com An: users@tomee.apache.org Datum: 15-04-2013 14:09 Betreff: Re: JPA issue in combo with @SessionScoped a conflict between cdi and jpa proxying the jpa entity makes another class created and then the jpa provider doesn't find back your entity *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/15 to...@orbit-x.de Hi, I have neither pure JPA nor CDI, nor EJB question, it's more of a mix: I have following classes (reasonably simplified) @javax.ejb.Stateless public class UserProducer { @PersistenceContext EntityManager entityManager; //Achtung, it produces a SessionScoped logged in user @Produces @SessionScoped @my.own.LoggedIn public User produceUser() { return entityManager.createQuery(..., User.class).getSingleResult(); } } @javax.ejb.Stateful public class AsyncWorker { @PersistenceContext EntityManager entityManager; @Asynchronous public void invokePersist(User user) { schedulerEntityService.persist(user); } } @RunWith(org.apache.openejb.junit.ApplicationComposer.class) class IntegrationTest { @Inject @LoggedIn User user; @Inject AsyncWorker asyncWorker; @Test public void testIt() { asyncWorker.invokePersist(user); //- No metadata was found for type class my.own.User_$$_javassist_7. The class does not appear in the list of persistent types: [my.own.User, ...]. } } The OpenJPA throws an org.apache.openjpa.persistence.ArgumentException No metadata was found for type class my.own.User_$$_javassist_7. The class does not appear in the list of persistent types: [my.own.User, ...]. FailedObject: my.own.User_$$_javassist_7-1 [java.lang.String] ONLY IF the producer method produceUser() is annotated as @SessionScoped. If I remove annotation, the test case works and User entity is being persisted. Can anyone imagine what it could be about? thank you for your ideas and kind regards Reinis
Re: Re[2]: Re[2]: JPA issue in combo with @SessionScoped
Problem is like Romain says, @SessionScoped objects are proxied instances. Not real instances of the class you think they are. To avoid this proxy, you need to reduce your scope or directly invoke the method. Personally, I wouldn't share my data model with my UI (need cleaner separation, force the application of business logic, etc); but that's just me. On Mon, Apr 15, 2013 at 10:04 AM, to...@orbit-x.de wrote: Hi John, but i am using EJB already (User producer and async worker). Do you mean injecting producer directly and then calling producerInstance.produceUser()? Yes I could do that, but the effect will be same as omitting @SessionScoped, right? My motivation was to get jpa representation of currently logged in user, to pack it once into session (to minimize jdbc although i just realized that openjpa caches!) and to reuse it whenever i want to CRUD something user-related in jpa. I heard (from Struberg?) that DeltaSpike is goin to offer a solution for this? Br Reinis -Ursprüngliche Nachricht- Betreff: Re: Re[2]: JPA issue in combo with @SessionScoped Von: John D. Ament john.d.am...@gmail.com An: users@tomee.apache.org Datum: 2013/04/15 15:18:50 The alternative is to just inject the EJB and call the method directly here. On Mon, Apr 15, 2013 at 8:14 AM, to...@orbit-x.de wrote: Hi Romain, thanks, I already guessed something like this. But is there some pattern to avoid this or work around or something I could use to make it work? Basically it means I may not use any cdi on jpa entities whatsoever and that is quite a constraint :) kind regards Reinis -Original-Nachricht- Von: Romain Manni-Bucau rmannibu...@gmail.com An: users@tomee.apache.org Datum: 15-04-2013 14:09 Betreff: Re: JPA issue in combo with @SessionScoped a conflict between cdi and jpa proxying the jpa entity makes another class created and then the jpa provider doesn't find back your entity *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/15 to...@orbit-x.de Hi, I have neither pure JPA nor CDI, nor EJB question, it's more of a mix: I have following classes (reasonably simplified) @javax.ejb.Stateless public class UserProducer { @PersistenceContext EntityManager entityManager; //Achtung, it produces a SessionScoped logged in user @Produces @SessionScoped @my.own.LoggedIn public User produceUser() { return entityManager.createQuery(..., User.class).getSingleResult(); } } @javax.ejb.Stateful public class AsyncWorker { @PersistenceContext EntityManager entityManager; @Asynchronous public void invokePersist(User user) { schedulerEntityService.persist(user); } } @RunWith(org.apache.openejb.junit.ApplicationComposer.class) class IntegrationTest { @Inject @LoggedIn User user; @Inject AsyncWorker asyncWorker; @Test public void testIt() { asyncWorker.invokePersist(user); //- No metadata was found for type class my.own.User_$$_javassist_7. The class does not appear in the list of persistent types: [my.own.User, ...]. } } The OpenJPA throws an org.apache.openjpa.persistence.ArgumentException No metadata was found for type class my.own.User_$$_javassist_7. The class does not appear in the list of persistent types: [my.own.User, ...]. FailedObject: my.own.User_$$_javassist_7-1 [java.lang.String] ONLY IF the producer method produceUser() is annotated as @SessionScoped. If I remove annotation, the test case works and User entity is being persisted. Can anyone imagine what it could be about? thank you for your ideas and kind regards Reinis
Re: Testing complex(?) CDI + EJB (+ ApplicationComposer) + JPA scenario brings up some questions
What you're seeing is correct (though I'm not a good one to ask why it's only at the trace level that you see this exception). I guess, why is HeavyProcessingControllerProdu**cer session scoped? There is no HTTP Session when this unit test runs, so no it won't be active at that time. On Wed, Apr 10, 2013 at 3:00 PM, Reinis Vicups to...@orbit-x.de wrote: Hi guys, got following scenario @org.junit.runner.RunWith(org.**apache.openejb.junit.** ApplicationComposer) public class IamIntegrationTest{ // ACHTUNG! @javax.enterprise.inject.**Produces @javax.enterprise.inject.New HeavyProcessingController heavyProcessingController; @org.apache.openejb.testing.**Module public PersistenceUnit somePersistenceConfigHere() { // boring code } @org.apache.openejb.testing.**Configuration public Properties settingUpSomeRessourceConfig() { // boring code } @Test public void iAmHeavyIntegrationTestMethod(**) { heavyProcessingController.**readALittleBitFromJPA(); heavyProcessingController.**initiateSomeHeavyProcessing(); } } // end test class @javax.enterprise.context.**SessionScoped public class HeavyProcessingControllerProdu**cer { @Inject JPAService jpaService; @Produces @RequestScoped public ListSomeEntity readALittleBitFromJPA() { jpaService.getEntityList(); } @javax.enterprise.inject.**Produces @javax.enterprise.inject.New public HeavyProcessingControllerprodu**ceHeavyProcessingController() { // ACHTUNG, invoking here JPA and it works! readALittleBitFromJPA(); // ACHTUNG, doing this because of some complex initialization logic required aforehand. return org.apache.myfaces.extensions.**cdi.core.impl.util.CodiUtils.** getContextualReferenceByClass(**HeavyProcessingController.**class); } } // end Producer class // ACHTUNG, this is stateful EJB Bean with no other explicit context annotations! @javax.ejb.Stateful public class HeavyProcessingController implements Serializable { @Inject AsyncHeavyProcessingWorker asyncWorker; public void initiateSomeHeavyProcessing() { // ACHTUNG! @Asynchronous method is invoked here asyncWorker.**asyncDoHeavyProcessingAndSaveY** ourWorkIntoPersistence(); } } // ACHTUNG, this is stateful EJB Bean with no other explicit context annotations! @javax.ejb.Stateful public class AsyncHeavyProcessingWorkerimpl**ements Serializable { @Inject JPAService jpaService; @Asynchronous public void asyncDoHeavyProcessingAndSaveY**ourWorkIntoPersistence(){ // ACHTUNG! jpaService.persist(**allThatHardWork); } } @javax.ejb.Stateless public class JPAService { @PersistenceContext EntityManager em; // ACHTUNG, no explicit TransacactionAttribute, using defaults! public void persist(SomeJPAEntity allThatHardWork) { em.persist(allThatHardWork); } - ACHTUNG, exceptionsomewhere here! } Executing this code causes following exception: 3389 default TRACE [@Asynchronous IntegrationTest - 1] openjpa.Runtime - org.apache.openjpa.**persistence.**EntityManagerFactoryImpl@**51d62781 created EntityManager org.apache.openjpa.**persistence.EntityManagerImpl@* *5ead44a4. 123394 default TRACE [@Asynchronous IntegrationTest - 1] openjpa.Runtime - An exception occurred while ending the transaction. This exception will be re-thrown. javax.enterprise.context.**ContextNotActiveException: WebBeans context with scope type annotation @SessionScoped does not exist within current thread at org.apache.webbeans.container.**BeanManagerImpl.getContext(** BeanManagerImpl.java:351) at org.apache.webbeans.intercept.**NormalScopedBeanInterceptorHan** dler.getContextualInstance(**NormalScopedBeanInterceptorHan** dler.java:143) at org.apache.webbeans.intercept.**NormalScopedBeanInterceptorHan** dler.invoke(**NormalScopedBeanInterceptorHan**dler.java:114) at org.apache.webbeans.intercept.**NormalScopedBeanInterceptorHan** dler.invoke(**NormalScopedBeanInterceptorHan**dler.java:108) *_at xyz.my.domain.User_$$_**javassist_3.pcGetStateManager(** User_$$_javassist_3.java)_* at org.apache.openjpa.kernel.**BrokerImpl.isDetached(** BrokerImpl.java:4580) at org.apache.openjpa.kernel.**SingleFieldManager.preFlushPC(** SingleFieldManager.java:775) at org.apache.openjpa.kernel.**SingleFieldManager.preFlush(** SingleFieldManager.java:621) at org.apache.openjpa.kernel.**SingleFieldManager.preFlush(** SingleFieldManager.java:589) at org.apache.openjpa.kernel.**SingleFieldManager.preFlush(** SingleFieldManager.java:505) at org.apache.openjpa.kernel.**StateManagerImpl.preFlush(** StateManagerImpl.java:2982) at org.apache.openjpa.kernel.**PNewState.beforeFlush(** PNewState.java:40) at org.apache.openjpa.kernel.**StateManagerImpl.beforeFlush(** StateManagerImpl.java:1054)
Re: Testing complex(?) CDI + EJB (+ ApplicationComposer) + JPA scenario brings up some questions
I would hope those interested in Application Composer also look at Arquillian for their automated testing needs (BTW: is your production target ENV just OpenEJB + OWB?) I think part of your issue is your use of @asynchronous. On Wed, Apr 10, 2013 at 3:28 PM, Reinis Vicups to...@orbit-x.de wrote: I guess, why is HeavyProcessingControllerProducer session scoped? There is no HTTP Session when this unit test runs, so no it won't be active at that time. Ok but why then the same session scoped bean is able to read from JPA with no issues two method calls before? As you may notice in stacktrace there's xyz.my.domain.User (xyz.my.domain.User_$_**javassist_3.pcGetStateManager) This is the currently logged in user entity read from DB by JPA and passed up and down the stacktrace (injected or as param) in next to every method call. Reason why the HeavyProcessingControllerProdu**cer is session scoped is that it produces stuff for currently logged in session user whether @New or existing. I understand your argument that theres no HTTP Session and it is obvious, I just thought (am still hoping) that the ApplicationComposer does some hard-core bootstrapping magic and weaves, javaasists or whatever dark arts are there required to allow me to junit-test all sorts of CDI/JSF/EJB beans, no? : br Reinis On 04/10/2013 09:14 PM, John D. Ament wrote: What you're seeing is correct (though I'm not a good one to ask why it's only at the trace level that you see this exception). I guess, why is HeavyProcessingControllerProducer session scoped? There is no HTTP Session when this unit test runs, so no it won't be active at that time. On Wed, Apr 10, 2013 at 3:00 PM, Reinis Vicups to...@orbit-x.de wrote: Hi guys, got following scenario ** @org.junit.runner.RunWith(org.** **apache.openejb.junit.** ApplicationComposer) public class IamIntegrationTest{ // ACHTUNG! @javax.enterprise.inject.Produces @javax.enterprise.inject.New HeavyProcessingController heavyProcessingController; @org.apache.openejb.testing.Module public PersistenceUnit somePersistenceConfigHere() { // boring code } @org.apache.openejb.testing.Configuration public Properties settingUpSomeRessourceConfig() { // boring code } @Test public void iAmHeavyIntegrationTestMethod() { heavyProcessingController.readALittleBitFromJPA(); heavyProcessingController.initiateSomeHeavyProcessing(); } } // end test class @javax.enterprise.context.SessionScoped public class HeavyProcessingControllerProducer { @Inject JPAService jpaService; @Produces @RequestScoped public ListSomeEntity readALittleBitFromJPA() { jpaService.getEntityList(); } @javax.enterprise.inject.Produces @javax.enterprise.inject.New public HeavyProcessingControllerprodu** **ceHeavyProcessingController(**) { // ACHTUNG, invoking here JPA and it works! readALittleBitFromJPA(); // ACHTUNG, doing this because of some complex initialization logic required aforehand. return org.apache.myfaces.extensions.cdi.core.impl.util.** CodiUtils.** getContextualReferenceByClass(HeavyProcessingController.class); } } // end Producer class // ACHTUNG, this is stateful EJB Bean with no other explicit context annotations! @javax.ejb.Stateful public class HeavyProcessingController implements Serializable { @Inject AsyncHeavyProcessingWorker asyncWorker; public void initiateSomeHeavyProcessing() { // ACHTUNG! @Asynchronous method is invoked here asyncWorker.asyncDoHeavyProcessingAndSaveY ourWorkIntoPersistence(); } } // ACHTUNG, this is stateful EJB Bean with no other explicit context annotations! @javax.ejb.Stateful public class AsyncHeavyProcessingWorkerimplements Serializable { @Inject JPAService jpaService; @Asynchronous public void asyncDoHeavyProcessingAndSaveY** **ourWorkIntoPersistence(){ // ACHTUNG! jpaService.persist(allThatHardWork); } } @javax.ejb.Stateless public class JPAService { @PersistenceContext EntityManager em; // ACHTUNG, no explicit TransacactionAttribute, using defaults! public void persist(SomeJPAEntity allThatHardWork) { em.persist(allThatHardWork); } - ACHTUNG, exceptionsomewhere here! } Executing this code causes following exception: 3389 default TRACE [@Asynchronous IntegrationTest - 1] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@ 51d62781 created EntityManager org.apache.openjpa. persistence.EntityManagerImpl@*** *5ead44a4. 123394 default TRACE [@Asynchronous IntegrationTest - 1] openjpa.Runtime - An exception occurred while ending the transaction. This exception
Re: Issue with @Context injection in CDI beans
Not from TomEE examples, but by understanding the JAX-RS spec a little bit. I think (IMHO) sometimes as open source programmers we jump quickly on the OMG someone found an issue I can fix before we think is this really an issue with the product or a limitation of the spec that the product implements? (not anything against Romain mind you) On Mon, Apr 8, 2013 at 9:53 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Ditto ( +1 ) and +1 this topic/thread and the responses. Definitely, good to know as I am hoping to use (REST) web services via TomEE, ASAP. Could this question/issue have been avoided after reading/reviewing TomEE documentation/examples? On Mon, Apr 8, 2013 at 9:30 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: yep +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Right, but it's still a server specific solution. Not a portable solution. The use of @Context in a CDI is especially bad since only @Inject and @EJB type injection is meant to work. On Mon, Apr 8, 2013 at 9:01 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: but now it works (and that's not forbidden by the spec AFAIK). DS doesn't have it ATM. The best alternative today is a web filter + a threadlocal IMO. what is common is to get it from the rest endpoints then propagate it to cdi beans all depends on your model *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Sorry , just noticed this was on the list twice. I believe this change actually violates the JAX-RS 1.1 spec, see here: http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-520005 JAX-RS provides facilities for obtaining and processing information about the application deployment context and the context of individual requests. Such information is available to Application subclasses (see section 2.1 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-110002.1 ), root resource classes (see chapter 3 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-180003 ), and providers (see chapter 4 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-390004 ). This chapter describes these facilities. CDI beans are none of those. John On Mon, Apr 8, 2013 at 3:48 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: https://issues.apache.org/jira/browse/TOMEE-888 done ;) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 Romain Manni-Bucau rmannibu...@gmail.com ok, the issue is the @Context resources are basically only available for rest endpoints ATM i'll dig to see if we can make it available to cdi beans without getting a big extra cost *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 Romain Manni-Bucau rmannibu...@gmail.com Think i know, can you try ServletRequest instead of httpservletrequest please (ill get a computer in 1h to go further) Le 8 avr. 2013 08:13, Antoine Reilles areilles+to...@gmail.com a écrit : Sure, here is the war I used, with its sources. I tried to get the sample minimalist, so it almost only performs System.out traces. On Mon, Apr 8, 2013 at 7:58 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: Hi You seem to have a sample project, can you share it or the war associated please? Le 8 avr. 2013 07:55, Antoine Reilles areilles+to...@gmail.com a écrit : Hi, I'm running into issues when defining a RequestScoped CDI bean to be injected in a jax-rs service, and initialized
Re: Issue with @Context injection in CDI beans
Problem here is that maybe only the dev system is TomEE. Maybe production is another app server. If you do something like this, it may become difficult to debug. At a bare minimum it should be documented that TomEE+ has this non-spec mandated injection target created for CDI beans that users may use at their own will but is not considered portable. If the docs are in a repo somewhere I can send a pull request for the change. On Mon, Apr 8, 2013 at 10:02 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: @john: yep, here i think offering the feature costs nothing for us and helps the user to don't care about the spec. Implementing 100% the specs with their spirits sometimes make the container not usable ;). And once again the spec never said it was not available for CDI beans, the spec states it is available for resource beans and as others @resource are available for cdi beans it seems consistent to offer it for me *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Not from TomEE examples, but by understanding the JAX-RS spec a little bit. I think (IMHO) sometimes as open source programmers we jump quickly on the OMG someone found an issue I can fix before we think is this really an issue with the product or a limitation of the spec that the product implements? (not anything against Romain mind you) On Mon, Apr 8, 2013 at 9:53 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Ditto ( +1 ) and +1 this topic/thread and the responses. Definitely, good to know as I am hoping to use (REST) web services via TomEE, ASAP. Could this question/issue have been avoided after reading/reviewing TomEE documentation/examples? On Mon, Apr 8, 2013 at 9:30 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: yep +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Right, but it's still a server specific solution. Not a portable solution. The use of @Context in a CDI is especially bad since only @Inject and @EJB type injection is meant to work. On Mon, Apr 8, 2013 at 9:01 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: but now it works (and that's not forbidden by the spec AFAIK). DS doesn't have it ATM. The best alternative today is a web filter + a threadlocal IMO. what is common is to get it from the rest endpoints then propagate it to cdi beans all depends on your model *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Sorry , just noticed this was on the list twice. I believe this change actually violates the JAX-RS 1.1 spec, see here: http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-520005 JAX-RS provides facilities for obtaining and processing information about the application deployment context and the context of individual requests. Such information is available to Application subclasses (see section 2.1 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-110002.1 ), root resource classes (see chapter 3 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-180003 ), and providers (see chapter 4 http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-390004 ). This chapter describes these facilities. CDI beans are none of those. John On Mon, Apr 8, 2013 at 3:48 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: https://issues.apache.org/jira/browse/TOMEE-888 done ;) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 Romain Manni-Bucau rmannibu...@gmail.com ok
Re: Issue with @Context injection in CDI beans
Antoine, Difference with seam 3 is that it's a portable CDI extension that provides the injection. It's not a container (e.g. no additional compilation or runtime dependency) provided solution. So it's clear to you (and through tooling) how the injection occurs. Actually the null proxy is pretty much the norm in these cases. It's not defined what should be injected here. John On Mon, Apr 8, 2013 at 10:53 AM, Antoine Reilles areilles+to...@gmail.comwrote: I agree this unportable behavior should be documented, since it will tie to a particular runtime (which is exactly what is done for seam3 http://docs.jboss.org/seam/3/servlet/latest/reference/en-US/html/injectablerefs.html ). I'm actually trying to replicate with tomee something I had done with jersey on a previous version of our product: the runtime now mandates tomee, where is was plain tomcat before; those two don't mix very happily. I' m trying to inject to services that need it a handle to a database, and manage transactions on request boundaries using the response status: read only transaction is initialized for GET requests, UPDATE for POST/PUT, and the transaction is committed or aborted depending on the http status, the resources being properly reclaimed at request completion. Another use case is to configure a logger using information from the request. I can probably simply reach my goal by passing the @context injected information from the jax-rs endpoint to the CDI bean for each request, using something like @Path public String service(@Context HttpServletRequest request, @Context HttpServletReponse) { mybean.initWith(request, response); ... } and have all users do that. In any case, @Context annontated fields in cdi beans should either recieve the jax-rs values (with proper documentation of non portability), or simply be left null, but not get a proxy to a null object Best regards, antoine On Mon, Apr 8, 2013 at 4:09 PM, John D. Ament john.d.am...@gmail.com wrote: Problem here is that maybe only the dev system is TomEE. Maybe production is another app server. If you do something like this, it may become difficult to debug. At a bare minimum it should be documented that TomEE+ has this non-spec mandated injection target created for CDI beans that users may use at their own will but is not considered portable. If the docs are in a repo somewhere I can send a pull request for the change. On Mon, Apr 8, 2013 at 10:02 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: @john: yep, here i think offering the feature costs nothing for us and helps the user to don't care about the spec. Implementing 100% the specs with their spirits sometimes make the container not usable ;). And once again the spec never said it was not available for CDI beans, the spec states it is available for resource beans and as others @resource are available for cdi beans it seems consistent to offer it for me *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Not from TomEE examples, but by understanding the JAX-RS spec a little bit. I think (IMHO) sometimes as open source programmers we jump quickly on the OMG someone found an issue I can fix before we think is this really an issue with the product or a limitation of the spec that the product implements? (not anything against Romain mind you) On Mon, Apr 8, 2013 at 9:53 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Ditto ( +1 ) and +1 this topic/thread and the responses. Definitely, good to know as I am hoping to use (REST) web services via TomEE, ASAP. Could this question/issue have been avoided after reading/reviewing TomEE documentation/examples? On Mon, Apr 8, 2013 at 9:30 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: yep +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Right, but it's still a server specific solution. Not a portable solution. The use of @Context in a CDI is especially bad since only @Inject and @EJB type injection is meant to work. On Mon, Apr 8, 2013 at 9:01 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: but now it works (and that's not forbidden by the spec AFAIK). DS
Re: Issue with @Context injection in CDI beans
Not sure what you mean, Seam works on all app servers AFAIK. It may be EOL but it's portable across app servers. On Mon, Apr 8, 2013 at 11:20 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Seam.is not portable at all Le 8 avr. 2013 16:58, John D. Ament john.d.am...@gmail.com a écrit : Antoine, Difference with seam 3 is that it's a portable CDI extension that provides the injection. It's not a container (e.g. no additional compilation or runtime dependency) provided solution. So it's clear to you (and through tooling) how the injection occurs. Actually the null proxy is pretty much the norm in these cases. It's not defined what should be injected here. John On Mon, Apr 8, 2013 at 10:53 AM, Antoine Reilles areilles+to...@gmail.comwrote: I agree this unportable behavior should be documented, since it will tie to a particular runtime (which is exactly what is done for seam3 http://docs.jboss.org/seam/3/servlet/latest/reference/en-US/html/injectablerefs.html ). I'm actually trying to replicate with tomee something I had done with jersey on a previous version of our product: the runtime now mandates tomee, where is was plain tomcat before; those two don't mix very happily. I' m trying to inject to services that need it a handle to a database, and manage transactions on request boundaries using the response status: read only transaction is initialized for GET requests, UPDATE for POST/PUT, and the transaction is committed or aborted depending on the http status, the resources being properly reclaimed at request completion. Another use case is to configure a logger using information from the request. I can probably simply reach my goal by passing the @context injected information from the jax-rs endpoint to the CDI bean for each request, using something like @Path public String service(@Context HttpServletRequest request, @Context HttpServletReponse) { mybean.initWith(request, response); ... } and have all users do that. In any case, @Context annontated fields in cdi beans should either recieve the jax-rs values (with proper documentation of non portability), or simply be left null, but not get a proxy to a null object Best regards, antoine On Mon, Apr 8, 2013 at 4:09 PM, John D. Ament john.d.am...@gmail.com wrote: Problem here is that maybe only the dev system is TomEE. Maybe production is another app server. If you do something like this, it may become difficult to debug. At a bare minimum it should be documented that TomEE+ has this non-spec mandated injection target created for CDI beans that users may use at their own will but is not considered portable. If the docs are in a repo somewhere I can send a pull request for the change. On Mon, Apr 8, 2013 at 10:02 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: @john: yep, here i think offering the feature costs nothing for us and helps the user to don't care about the spec. Implementing 100% the specs with their spirits sometimes make the container not usable ;). And once again the spec never said it was not available for CDI beans, the spec states it is available for resource beans and as others @resource are available for cdi beans it seems consistent to offer it for me *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/8 John D. Ament john.d.am...@gmail.com Not from TomEE examples, but by understanding the JAX-RS spec a little bit. I think (IMHO) sometimes as open source programmers we jump quickly on the OMG someone found an issue I can fix before we think is this really an issue with the product or a limitation of the spec that the product implements? (not anything against Romain mind you) On Mon, Apr 8, 2013 at 9:53 AM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: Ditto ( +1 ) and +1 this topic/thread and the responses. Definitely, good to know as I am hoping to use (REST) web services via TomEE, ASAP. Could this question/issue have been avoided after reading/reviewing TomEE documentation/examples? On Mon, Apr 8, 2013 at 9:30 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: yep +1 *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http
Re: TomEE 5
That may be, but you still won't necessarily have support for JSF, JPA etc built in only only OWB w/ Servlet option. Not a complete stack like TomEE. John On Fri, Apr 5, 2013 at 12:39 PM, Howard W. Smith, Jr. smithh032...@gmail.com wrote: for tomcat6, you may need to consider openejb instead of tomee. On Fri, Apr 5, 2013 at 12:34 PM, John D. Ament john.d.am...@gmail.com wrote: TomEE is typically a separate installation, not something you install on top of Tomcat. On Fri, Apr 5, 2013 at 10:47 AM, rajiv.j...@netbuilder.com rajiv.j...@netbuilder.com wrote: Hi I installed TomEE plus version 1.5.1. It has Tomcat version 7. Can TomEE be used with Tomcat 6? It is possible? Having a quick search on Google, doesn't give anything back. -- View this message in context: http://openejb.979440.n4.nabble.com/TomEE-5-tp4662017.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to reference an EJB in an EAR from a separate WAR?
Using CDI, you should be able to write an extension that observes BeforeBeanDiscovery to add the annotated types using beanManager.createAnnotatedType(Interface.class) and Impl.class. On Wed, Apr 3, 2013 at 12:56 PM, ymaraner tpha...@gmail.com wrote: Romain Manni-Bucau wrote remote reference are obtained either using a lookup or openejb remote injection feature (see http://tomee.apache.org/ejb-refs.html) I had looked at that page; however, the problem with these approaches is that they all involve entries in the ejb-jar.xml file for EJBs that access remote EJBs. I'm trying to reference the remote EJB from a POJO. It has no ejb-jar.xml file. Is it possible to inject a remote EJB reference into a POJO in a different application using CDI? Or does the @EJB or @Inject annotation have to be inside of another EJB in order to obtain the remote reference? - - Tim -- View this message in context: http://openejb.979440.n4.nabble.com/How-to-reference-an-EJB-in-an-EAR-from-a-separate-WAR-tp4661962p4661964.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: web application not work with db mysql and derby
According to your code, line 45 is: out.println( Servlet InserimentoServlet at + request.getContextPath() + ); though it would be easier if you gist'd this since the lines don't necessary match up correctly. But that would imply that the request is null at this time. Can you gist it? I don't think you sent the full servlet class (since it's however it's being called on line 84.) Is it possible you're not passing in the request object? On Wed, Apr 3, 2013 at 10:51 AM, mauro2java2011 mauro2java2...@gmail.comwrote: yes into web-inf i have: beans.xml ?xml version=1.0 encoding=UTF-8? beans xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd; /beans . the servlet: --- package srv2; import ejb.GestoreEjb; import entita.Persona; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author spazio */ @WebServlet(name = Servlet1, urlPatterns = {/Servlet1}) public class Servlet1 extends HttpServlet { @Inject GestoreEjb miogestore; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html;charset=UTF-8); PrintWriter out = response.getWriter(); try { ListPersona elencoPersone= this.miogestore.getElencoPersone(); /* TODO output your page here. You may use following sample code. */ out.println(!DOCTYPE html); out.println(html); out.println(head); out.println(titleServlet ElencoPersoneServlet/title); out.println(/head); out.println(body); out.println( Servlet ElencoPersoneServlet at + request.getContextPath() + ); for (Persona p: elencoPersone) { out.println(id=+p.getId()+ nome=+p.getNome()); out.println(br/); } out.println(/body); out.println(/html); }catch (Exception e){ e.printStackTrace(out); } finally { out.close(); } } ... the servlet2 package srv2; import ejb.GestoreEjb; import entita.Persona; import java.io.IOException; import java.io.PrintWriter; import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author spazio */ @WebServlet(name = Servlet2, urlPatterns = {/Servlet2}) public class Servlet2 extends HttpServlet { @Inject GestoreEjb miogestore; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html;charset=UTF-8); PrintWriter out = response.getWriter(); try { String nome = request.getParameter(nome); Persona p = new Persona(nome); this.miogestore.persist(p); /* TODO output your page here. You may use following sample code. */ out.println(!DOCTYPE html); out.println(html); out.println(head); out.println(titleServlet InserimentoServlet/title); out.println(/head); out.println(body); out.println( Servlet InserimentoServlet at + request.getContextPath() + ); out.println(inserimento eseguito); out.println(br/); out.println(/body); out.println(/html); } catch (Exception e) { e.printStackTrace(out); } finally { out.close(); } } - the index.jsp : %@page contentType=text/html pageEncoding=UTF-8% !DOCTYPE html html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleJSP Page/title /head body form action=Servlet2 input type=text name=nome value= / input type=submit value=ok /input type=reset value=reset / /form Elenco persone nel database Servlet1 /body /html the ejb: package ejb; import entita.Persona; import
Re: How to reference an EJB in an EAR from a separate WAR?
I don't believe that's the EJB. Singleton is still a generic singleton typed object. You could always test this idea out by putting a log statement in the constructor and seeing how many times it gets called. On Wed, Apr 3, 2013 at 1:19 PM, ymaraner tpha...@gmail.com wrote: John D. Ament wrote Using CDI, you should be able to write an extension that observes BeforeBeanDiscovery to add the annotated types using beanManager.createAnnotatedType(Interface.class) and Impl.class. Looking at those APIs; it doesn't look like I would get a reference to the Singleton in my other application but rather a new instance of the class in my web application. Not really what I was looking for. - - Tim -- View this message in context: http://openejb.979440.n4.nabble.com/How-to-reference-an-EJB-in-an-EAR-from-a-separate-WAR-tp4661962p4661967.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: maximum open cursors exceeded in entity bean
In this database (e.g. according to DBA), what is the max # of cursors set to? On Tue, Apr 2, 2013 at 7:01 AM, BKumar bibhuti.ku...@creditpointe.comwrote: Hi, We have recently migrated to tomee+ 1.5.1 from Jboss. Until now everything was working good. But when we are running large processes it is throwing error maximum open cursors exceeded. We have around 60 entity beans(CMP) .Also, We are not manually opening or closing any connection everything is done by Container only.We are just working on Entity. After googling we found this may be related to statement caching, which is controlled two property i.e. PoolPreparedStatements and maxOpenPreparedStatements in tomee.xml. Tomee.xml ::: Resource id=RageDataSource type=DataSource JdbcDriver oracle.jdbc.driver.OracleDriver JdbcUrl jdbc:oracle:thin:@ID:5584:PLTDEV UserName test Password test JtaManaged true PoolPreparedStatements true maxOpenPreparedStatements 200 /Resource Resource id=RageNoTxDataSource type=DataSource JdbcDriver oracle.jdbc.driver.OracleDriver JdbcUrl jdbc:oracle:thin:@ID:5584:PLTDEV UserName test Password test JtaManaged false PoolPreparedStatements true maxOpenPreparedStatements 200 /Resource Error: javax.ejb.EJBException: The transaction has been marked rollback only because the bean encountered a non-application exception :org.apache.openjpa.persistence.PersistenceException : ORA-00604: error occurred at recursive SQL level 1 ORA-01000: maximum open cursors exceeded ORA-00604: error occurred at recursive SQL level 1 ORA-01000: maximum open cursors exceeded ORA-01000: maximum open cursors exceeded {prepstmnt 1636515580 SELECT t0.CMPT_SEQ_ID, t0.TFP_PROPERTYNAME, t0.TFP_PROPVAL, t0.TFP_PROPVAL_DATATYPE, t0.TFP_UPDATE_COUNT FROM TASK_CONFIGURATION t0 WHERE (t0.CMPT_SEQ_ID = ?) [params=?]} [code=604, state=6] at com.rage.common.util.AppServerUtility.getException(AppServerUtility.java:412) at com.rage.common.dal.TaskDBUtility.getTaskConfigurations(TaskDBUtility.java:3011) at com.rage.process.bizcomp.ProcessFlowchartFacadeBean.get(ProcessFlowchartFacadeBean.java:317) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:128) at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:43) at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:64) at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:70) at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95) at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:237) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:189) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:253) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:248) at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:92) at
Re: maximum open cursors exceeded in entity bean
Agreed w/ Jean-Louis. Usually we do 10x the max open statements to get the max open cursors to configure the DB with. Plus x the number of app servers. On Tue, Apr 2, 2013 at 7:59 AM, Jean-Louis MONTEIRO jeano...@gmail.comwrote: Well, usually, it comes from the ratio pooledPreparedStatements and the number of connections. Here you are running with default, so it should be 8 connections. As per the way Oracle actually works, the cursor can remain opened with the preparedStatement. Jean-Louis 2013/4/2 BKumar bibhuti.ku...@creditpointe.com In tomee.xml I have set resource as below.But still no luck. Is any other property I am missing here? Which will stop holding cursor by the container. Resource id=RageDataSource type=DataSource JdbcDriver oracle.jdbc.driver.OracleDriver JdbcUrl jdbc:oracle:thin:@ID:5584:PLTDEV UserName test Password test JtaManaged true DataSourceCreator = dbcp PoolPreparedStatements true maxOpenPreparedStatements 200 /Resource Resource id=RageNoTxDataSource type=DataSource JdbcDriver oracle.jdbc.driver.OracleDriver JdbcUrl jdbc:oracle:thin:@ID:5584:PLTDEV UserName test Password test JtaManaged false DataSourceCreator = dbcp PoolPreparedStatements true maxOpenPreparedStatements 200 /Resource -- View this message in context: http://openejb.979440.n4.nabble.com/maximum-open-cursors-exceeded-in-entity-bean-tp4661896p4661902.html Sent from the OpenEJB User mailing list archive at Nabble.com. -- Jean-Louis
Re: maximum open cursors exceeded in entity bean
Cursors are related to the max # of open ResultSets you have. On Tue, Apr 2, 2013 at 8:48 AM, BKumar bibhuti.ku...@creditpointe.comwrote: Can anyone tell me what is the use of properties PoolPreparedStatements and maxOpenPreparedStatements? I don't see any effect of these resource property on cursor size. When I run on Tomee active cursor count keep on increasing and come down when process end. When I make my process bigger(this can be of very huge size) at some point Active cursor count become more than DB cursor size and fails.So, Here I cannot decide the size of cursor on DB. But I didn't observe above behavior if i run the same huge process on Jboss it is static. -- View this message in context: http://openejb.979440.n4.nabble.com/maximum-open-cursors-exceeded-in-entity-bean-tp4661896p4661907.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: JNDI lookup
Why do you have a context name in dev/test but not in production? On Fri, Mar 29, 2013 at 3:45 PM, Patel, Sanjay sanjay.pa...@nemours.orgwrote: I use EJBs in my spring application. To inject EJB in my controller I do as below. @EJB(mappedName = java:global/myAppName/MyBean) MyBean myBean; It works fine. Now when I deploy my application in production, It fails to find EJB. Because there is no context in my production environment, EJBs get deployed in TomEE like java:global//MyBean. So the spring controller cannot find the EJBs. Is there any better way to inject EJBs?
Re: Maven, Netbeans, TomEE: set up easy CDI example
So basically your DescriptorResource needs to look like this: @RequestScoped @Path(descriptor) public class DescriptorResource { But then in your put method, you're doing this: public Response putXml(String content) { System.out.println(--Server received from client:--); System.out.println(content); System.out.println(--end---); AreeReferee ar = new AreeReferee(); ar.doSomething(); Which means you're not using CDI now. You should instead do this: @Inject private AreeReferee ar; /** * PUT method for updating or creating an instance of DescriptorResource * @param content representation for the resource * @return an HTTP response with content of the updated or created resource. */ @PUT @Path(/put) @Consumes(application/xml) public Response putXml(String content) { System.out.println(--Server received from client:--); System.out.println(content); System.out.println(--end---); ar.doSomething(); On Tue, Mar 26, 2013 at 7:01 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: your rest service endpoint is a cdi bean and the bean doing the processing too (AreeReferee). this last one uses @inject but you did a new in the rest endpoint so it is not handled by cdi... us @inject and it will be fine *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/3/26 Caroline Van den Hauwe caroline.van.den.ha...@gmail.com I'm unsure about your question, at http://cl.ly/3F0g1N3i1d42/download/carolinevandenhauwe-TomEE-CDI-REST.zipyoucan find an archive containing my project files. Op dinsdag 26 maart 2013, om 11:42 heeft Romain Manni-Bucau het volgende geschreven: Hmm, think your rest mapping have an issue, can you share a project reproducing it? *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/3/26 Caroline Van den Hauwe caroline.van.den.ha...@gmail.com (mailto: caroline.van.den.ha...@gmail.com) Thanks for your quick reply Romain. When I install the 1.6.0-SNAPSHOT, the server gives the following error when I want to run the project (not yet the Main client code) and my localhost:8080/Aree Hello World jsp page doesn't work: 26-mrt-2013 11:36:23 org.apache.openejb.assembler.classic.Assembler destroyApplication INFO: Undeploying app: /Users/caroline/Thesis/Code/Aree/target/Aree-1.0-SNAPSHOT 26-mrt-2013 11:36:24 org.apache.catalina.startup.HostConfig deleteRedeployResources INFO: Undeploying context [/Aree] 26-mrt-2013 11:36:24 org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor /usr/local/apache-tomee-jaxrs-1.6.0-SNAPSHOT/conf/Catalina/localhost/Aree.xml 26-mrt-2013 11:36:24 org.apache.tomee.catalina.TomcatWebAppBuilder init INFO: - localhost - /Aree 26-mrt-2013 11:36:24 org.apache.openejb.config.ConfigurationFactory configureApplication INFO: Configuring enterprise application: /Users/caroline/Thesis/Code/Aree/target/Aree-1.0-SNAPSHOT 26-mrt-2013 11:36:24 org.apache.openejb.config.AppInfoBuilder build INFO: Enterprise application /Users/caroline/Thesis/Code/Aree/target/Aree-1.0-SNAPSHOT loaded. 26-mrt-2013 11:36:24 org.apache.openejb.assembler.classic.Assembler createApplication INFO: Assembling app: /Users/caroline/Thesis/Code/Aree/target/Aree-1.0-SNAPSHOT 26-mrt-2013 11:36:24 org.apache.openejb.cdi.CdiBuilder initSingleton INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@27af8502 26-mrt-2013 11:36:24 org.apache.openejb.cdi.OpenEJBLifecycle startApplication INFO: OpenWebBeans Container is starting... 26-mrt-2013 11:36:24 org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [CdiPlugin] 26-mrt-2013 11:36:24 org.apache.webbeans.plugins.PluginLoader startUp INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] 26-mrt-2013 11:36:24 org.apache.openejb.cdi.BeansDeployer validateInjectionPoints INFO: All injection points are validated successfully. 26-mrt-2013 11:36:24 org.apache.openejb.cdi.OpenEJBLifecycle startApplication INFO: OpenWebBeans Container has started, it took 8 ms. 26-mrt-2013 11:36:24 org.apache.tomee.catalina.TomcatWebAppBuilder deployWebApps INFO: using context file
Re: Impossible to instantiate a container
Can you gist your test case by any chance? On Tue, Mar 12, 2013 at 7:51 AM, Antonio anttonij...@gmail.com wrote: Hi there, I deleted the provider line but I'm still getting an error --- T E S T S --- Running com.altobridge.omc.orm.dao.UserProfileDaoLocalTest INFO - INFO - OpenEJB http://openejb.apache.org/ INFO - Startup: Tue Mar 12 11:34:51 GMT 2013 INFO - Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights Reserved. INFO - Version: 4.5.1 INFO - Build date: 20121209 INFO - Build time: 08:47 INFO - INFO - openejb.home = /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target INFO - openejb.base = /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@3ba08dab INFO - Succeeded in installing singleton service INFO - Using 'javax.ejb.embeddable.EJBContainer=true' INFO - Cannot find the configuration file [conf/openejb.xml]. Will attempt to create one for the beans deployed. INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service) INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager) INFO - Creating TransactionManager(id=Default Transaction Manager) INFO - Creating SecurityService(id=Default Security Service) INFO - Found EjbModule in classpath: /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target/classes INFO - Beginning load: /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target/classes INFO - Configuring enterprise application: /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target INFO - Auto-deploying ejb UserProfileDao: EjbDeployment(deployment-id=UserProfileDao) INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) INFO - Auto-creating a container for bean UserProfileDao: Container(type=STATELESS, id=Default Stateless Container) INFO - Creating Container(id=Default Stateless Container) INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container) INFO - Auto-creating a container for bean com.altobridge.omc.orm.dao.UserProfileDaoLocalTest: Container(type=MANAGED, id=Default Managed Container) INFO - Creating Container(id=Default Managed Container) INFO - Using directory /tmp for stateful session passivation INFO - Configuring PersistenceUnit(name=aomdb_unit, provider=org.eclipse.persistence.jpa.PersistenceProvider) INFO - Configuring Service(id=Default JDBC Database, type=Resource, provider-id=Default JDBC Database) INFO - Auto-creating a Resource with id 'Default JDBC Database' of type 'DataSource for 'aomdb_unit'. INFO - Creating Resource(id=Default JDBC Database) INFO - Configuring Service(id=Default Unmanaged JDBC Database, type=Resource, provider-id=Default Unmanaged JDBC Database) INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC Database' of type 'DataSource for 'aomdb_unit'. INFO - Creating Resource(id=Default Unmanaged JDBC Database) INFO - Adjusting PersistenceUnit aomdb_unit jta-data-source to Resource ID 'Default JDBC Database' from 'postgresDatabase' INFO - Adjusting PersistenceUnit aomdb_unit non-jta-data-source to Resource ID 'Default Unmanaged JDBC Database' from 'postgresDatabaseUnmanaged' INFO - Enterprise application /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target loaded. INFO - Assembling app: /home/antonio/builds/working_copy2/tomee_framework/omc/omc-aomdb-model-ejb/target INFO - PersistenceUnit(name=aomdb_unit, provider=org.eclipse.persistence.jpa.PersistenceProvider) - provider time 1851ms INFO - Jndi(name=java:global/omc-aomdb-model-ejb/UserProfileDao!com.altobridge.omc.orm.dao.UserProfileDaoLocal) INFO - Jndi(name=java:global/omc-aomdb-model-ejb/UserProfileDao) INFO - Existing thread singleton service in SystemInstance() org.apache.openejb.cdi.ThreadSingletonServiceImpl@3ba08dab INFO - OpenWebBeans Container is starting... INFO - Adding OpenWebBeansPlugin : [CdiPlugin] INFO - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin] INFO - All injection points are validated successfully. INFO - OpenWebBeans Container has started, it took 138 ms. INFO - Created Ejb(deployment-id=UserProfileDao, ejb-name=UserProfileDao, container=Default Stateless Container) INFO - Started Ejb(deployment-id=UserProfileDao, ejb-name=UserProfileDao, container=Default Stateless Container) INFO - Deployed
Re: Jax-RS ApplicationPath ignored
Most other app servers (GF, WebSphere) support it. There's actually a bug in RESTEasy right now blocking it. On Tue, Mar 5, 2013 at 3:42 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Nothing allows it too ;). Defining it through web.xml would work. Through auto discovering...that's not in the specs at all Le 5 mars 2013 21:25, James Green james.mk.gr...@gmail.com a écrit : I got it to break. https://github.com/jmkgreen/jaxrs-twoapp deploy that and watch the root paths disappear. It's just because I added a second JAX-RS Application. I don't see anything in the spec to prevent that. James On 4 March 2013 17:14, Romain Manni-Bucau rmannibu...@gmail.com wrote: @James: please reproduce it since i tested it and it worked for me *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/3/4 John D. Ament john.d.am...@gmail.com Can you override this using the servlet mapping? On Mon, Mar 4, 2013 at 12:11 PM, James Green james.mk.gr...@gmail.com wrote: Just wanted to confirm that for us with a week-old 1.6.0 snapshot, JAX-RS ApplicationPath has no effect. The log shows JAX-RS endpoints created minus this path, and accessing this with the path ends up with a 404, but accessing them without the path brings up the code. What should be contextPath/api/myresource is now contextPath/myresource. Which is going to make routing requests from the outside world interesting... James
Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart
Are you able to query that file to see the contents? What's in there as your application is running? On Mon, Mar 4, 2013 at 8:12 AM, dmitry.vol...@eiskonzept.com wrote: Hi. CalenderTimers created with following code are not recovered after TomEE restart. Are there some TomEE properties to make timers persistent across restarts? There is issue reproduction: https://github.com/eiskonzept/tomee.git Just start tomee plugin with node1 profile, open context_path/schedule.xhtml and push Schedule timer Button. Timer is scheduled(executed every second, see log) and listed on the page. Restart application, open context_path/schedule.xhtml again. There are no scheduled timers. Regards. Dmitry Volkov. Timer creation: @Resource private TimerService timerService; @Override @Timeout public void scheduleMe() { log.warn(Scheduled method executed. + new Date().toString()); } @Override public void schedule() { ScheduleExpression schedule = new ScheduleExpression(); schedule.hour(*); schedule.minute(*); schedule.second(*); timerService.createCalendarTimer(schedule, new TimerConfig(null, true)); } Quartz config: org.quartz.scheduler.instanceName = myScheduler org.quartz.scheduler.instanceId = instance1 org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true org.quartz.scheduler.makeSchedulerThreadDaemon=true org.quartz.jobStore.makeThreadsDaemons=true org.quartz.jobStore.dataSource = testDS org.quartz.jobStore.nonManagedTXDataSource = testDSNonJta org.quartz.threadPool.threadCount = 10 org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.HSQLDBDelegate org.quartz.jobStore.isClustered = true org.quartz.jobStore.tablePrefix = QRTZ_ org.quartz.dataSource.testDS.jndiURL=java:/jdbc/testDS org.quartz.dataSource.testDSNonJta.jndiURL=java:/jdbc/testDSNonJta DataSource config: Resource id=jdbc/testDS type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged true ConnectionProperties /Resource Resource id=jdbc/testDSNonJta type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged false ConnectionProperties /Resource
Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart
Yes, that file. Where does it end up getting created? On Mon, Mar 4, 2013 at 10:49 AM, dmitry.vol...@eiskonzept.com wrote: Sorry, don't get your question. Which file do you mean? Test.db? -Ursprüngliche Nachricht- Von: John D. Ament [mailto:john.d.am...@gmail.com] Gesendet: Montag, 4. März 2013 15:17 An: users@tomee.apache.org Betreff: Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart Are you able to query that file to see the contents? What's in there as your application is running? On Mon, Mar 4, 2013 at 8:12 AM, dmitry.vol...@eiskonzept.com wrote: Hi. CalenderTimers created with following code are not recovered after TomEE restart. Are there some TomEE properties to make timers persistent across restarts? There is issue reproduction: https://github.com/eiskonzept/tomee.git Just start tomee plugin with node1 profile, open context_path/schedule.xhtml and push Schedule timer Button. Timer is scheduled(executed every second, see log) and listed on the page. Restart application, open context_path/schedule.xhtml again. There are no scheduled timers. Regards. Dmitry Volkov. Timer creation: @Resource private TimerService timerService; @Override @Timeout public void scheduleMe() { log.warn(Scheduled method executed. + new Date().toString()); } @Override public void schedule() { ScheduleExpression schedule = new ScheduleExpression(); schedule.hour(*); schedule.minute(*); schedule.second(*); timerService.createCalendarTimer(schedule, new TimerConfig(null, true)); } Quartz config: org.quartz.scheduler.instanceName = myScheduler org.quartz.scheduler.instanceId = instance1 org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true org.quartz.scheduler.makeSchedulerThreadDaemon=true org.quartz.jobStore.makeThreadsDaemons=true org.quartz.jobStore.dataSource = testDS org.quartz.jobStore.nonManagedTXDataSource = testDSNonJta org.quartz.threadPool.threadCount = 10 org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.HSQLDBDelegate org.quartz.jobStore.isClustered = true org.quartz.jobStore.tablePrefix = QRTZ_ org.quartz.dataSource.testDS.jndiURL=java:/jdbc/testDS org.quartz.dataSource.testDSNonJta.jndiURL=java:/jdbc/testDSNonJta DataSource config: Resource id=jdbc/testDS type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged true ConnectionProperties /Resource Resource id=jdbc/testDSNonJta type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged false ConnectionProperties /Resource
Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart
There's no attachment. On Mon, Mar 4, 2013 at 11:16 AM, dmitry.vol...@eiskonzept.com wrote: 4 files are created in project root(I start tomee maven plugin here): \test.db.lck \test.db.log \test.db.properties \test.db.script I have purged all this files, then restarted TomEE, scheduled a job and stopped TomEE after a while. Please find attached test.db.log file. -Ursprüngliche Nachricht- Von: John D. Ament [mailto:john.d.am...@gmail.com] Gesendet: Montag, 4. März 2013 16:56 An: users@tomee.apache.org Betreff: Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart Yes, that file. Where does it end up getting created? On Mon, Mar 4, 2013 at 10:49 AM, dmitry.vol...@eiskonzept.com wrote: Sorry, don't get your question. Which file do you mean? Test.db? -Ursprüngliche Nachricht- Von: John D. Ament [mailto:john.d.am...@gmail.com] Gesendet: Montag, 4. März 2013 15:17 An: users@tomee.apache.org Betreff: Re: CalendarTimers created with TimerService and persistent=true are not persisted over tomee restart Are you able to query that file to see the contents? What's in there as your application is running? On Mon, Mar 4, 2013 at 8:12 AM, dmitry.vol...@eiskonzept.com wrote: Hi. CalenderTimers created with following code are not recovered after TomEE restart. Are there some TomEE properties to make timers persistent across restarts? There is issue reproduction: https://github.com/eiskonzept/tomee.git Just start tomee plugin with node1 profile, open context_path/schedule.xhtml and push Schedule timer Button. Timer is scheduled(executed every second, see log) and listed on the page. Restart application, open context_path/schedule.xhtml again. There are no scheduled timers. Regards. Dmitry Volkov. Timer creation: @Resource private TimerService timerService; @Override @Timeout public void scheduleMe() { log.warn(Scheduled method executed. + new Date().toString()); } @Override public void schedule() { ScheduleExpression schedule = new ScheduleExpression(); schedule.hour(*); schedule.minute(*); schedule.second(*); timerService.createCalendarTimer(schedule, new TimerConfig(null, true)); } Quartz config: org.quartz.scheduler.instanceName = myScheduler org.quartz.scheduler.instanceId = instance1 org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true org.quartz.scheduler.makeSchedulerThreadDaemon=true org.quartz.jobStore.makeThreadsDaemons=true org.quartz.jobStore.dataSource = testDS org.quartz.jobStore.nonManagedTXDataSource = testDSNonJta org.quartz.threadPool.threadCount = 10 org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.HSQLDBDelegate org.quartz.jobStore.isClustered = true org.quartz.jobStore.tablePrefix = QRTZ_ org.quartz.dataSource.testDS.jndiURL=java:/jdbc/testDS org.quartz.dataSource.testDSNonJta.jndiURL=java:/jdbc/testDSNonJta DataSource config: Resource id=jdbc/testDS type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged true ConnectionProperties /Resource Resource id=jdbc/testDSNonJta type=javax.sql.DataSource JdbcDriver org.hsqldb.jdbcDriver JdbcUrl jdbc:hsqldb:file:test.db UserName sa Password JtaManaged false ConnectionProperties /Resource
Re: JDBC Connection Pool reconnects on each connection usage
Witold, Maybe we have bad assumptions. Are you assuming that connection pooling is enabled by default in datasources? John On Thu, Feb 28, 2013 at 7:33 AM, Witold Szczerba pljosh.m...@gmail.comwrote: OK, maybe I am blind or maybe I just do not get it at all. I was reading entire JDBC connection pool documentation of TomEE and Tomcat before posting to this thread and, even with your explicit links provided, there is nothing (at least I cannot find nothing) about the issue I have described (not how to handle connection leaks which I do not have). Can you, please, tell me exactly, I mean exactly where in the docs it is described (or other kind of hint), that the configuration like I have provided (which is exactly the same as in common-datasource-configurations.html) makes broken Tomcat connection pool? I mean totally broken (application works now like 100 times faster). Regards, Witold Szczerba On 28 February 2013 13:00, John D. Ament john.d.am...@gmail.com wrote: Witold, The entry I added is based on this page in the Tomcat docs: http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_(DBCP)_Configurations In addition, at the bottom of the TomEE datasource page you can see it noted (though it's somewhat hidden) http://tomee.apache.org/common-datasource-configurations.html Though I do +1 your sentiment with the configuration. TomEE ends up reliant on the upstream project's docs. John On Thu, Feb 28, 2013 at 6:10 AM, Witold Szczerba pljosh.m...@gmail.com wrote: One thing I can say just now is that setting DataSourceCreator to DBCP makes a HUGE difference in performance. That connection pool works as a one would expect any connection pool to work. Have not tried the extra interceptors on top of Tomcat Connection Pool, but as long as I can keep far away from it, I am fine. The only thing I would suggest for TomEE project for now would be to supplement the documentation, so every one, picking TomEE as their app server of choice, would be warned about the issue. Thanks, Witold Szczerba On 28 February 2013 02:39, John D. Ament john.d.am...@gmail.com wrote: When I run your example on my local machine, using Tomee 1.5.1 w/ jax-rs and mysql, I get the same results. However, switching to dbcp pooling changes that. Resource id=jdbc/resource type=DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/ex UserName ex Password abc123 JtaManaged true DataSourceCreator dbcp /Resource And sorry, missing the brackets around your try. John On Wed, Feb 27, 2013 at 7:58 PM, Witold Szczerba pljosh.m...@gmail.com wrote: Well, all the properties you have mentioned have sane defaults, that's why I did not specified them. Also, the try (...) statement (called try-with-resources), introduced in Java7, is calling #close method, so the connection is handled correctly. Regards, Witold Szczerba --- Sent from my mobile phone. On Feb 28, 2013 1:12 AM, John D. Ament john.d.am...@gmail.com wrote: It seems like you don't have initialSize, maxIdle, maxActive, minIdle or maxWait set. Also, I don't think you're returning the connection to the pool. On Wed, Feb 27, 2013 at 6:37 PM, Witold Szczerba pljosh.m...@gmail.com wrote: Hi, I am facing something very strange. I am not 100% sure if this is true, but everything looks like the connection pool actually reconnects to database, I mean it closes the TCP connection and creates new one, over and over, instead of reusing connections. To make sure it is not an issue with my application, I have created a new project with only one class: /** * * @author witoldsz */ @Path(/resource) @Stateless public class Endpoint { @Resource(name = jdbc/resource) private DataSource ds; @GET @Produces(MediaType.TEXT_PLAIN) public String hello() throws Exception { try (Connection conn = ds.getConnection()) { //do nothing, just fetch and close the connection } return Hello!; } } The JDBC resource is actually an Oracle 11g. Now hear this: each time I do a HTTP GET: http://localhost:8080/app/resource I can see a new connection being established and the previous one closed, used iptraf to monitor. Also, the: -- SELECT username, sid, serial#, logon_time, machine, port FROM v$session WHERE username = 'MY_USER_NAME