Re: Strange resource adapter error message
Thanks for sharing your project. I've done outbound connection pools before but never inbound, so it's great to have a sample. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Strange-resource-adapter-error-message-tp4674170p4674177.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Just curious, what parts of JEE is everyone using?
Jean-Louis MONTEIRO wrote JCA (outbound connection pool with transaction support) Very cool part of Java EE but not well known. So true. I've actually never met anyone in person that has built a JCA adapter. Most people try to solve the problem JCA solves by re-inventing the wheel and usually because they just don't know what JCA can do for them. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Just-curious-what-parts-of-JEE-is-everyone-using-tp4673713p4673747.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Just curious, what parts of JEE is everyone using?
EJB3 (singletons, transactions and asynchronous) JMS JAX-WS (client and server) JAX-RS (client and server) JSF (only for html rendering of JAX-RS responses) CDI (how can you not use it?) JTA JPA Servlets Filters JCA (outbound connection pool with transaction support) -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Just-curious-what-parts-of-JEE-is-everyone-using-tp4673713p4673738.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 1.7.2 Release Date
Any change of getting a cxf upgrade with this release? If not to cxf3, then at least cxf2.7.x? Just thought i'd ask since i really want the nio client capability :) -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-1-7-2-Release-Date-tp4673133p4673148.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 1.7.2 Release Date
Thanks brilliant. I thought i'd have to wait for 2.0 for it. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-1-7-2-Release-Date-tp4673133p4673150.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 1.7.2 Release Date
Ok i think i misunderstood. I was assuming 1.7.2 would be released before 2.0 and if so, it would be nice to get cfx 2.7 or higher in that release. I just checked the 1.7.x branch and see cxf.version is 2.6.14 in the pom.xml so guess it's not in scope to upgrade it for 1.7.2? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-1-7-2-Release-Date-tp4673133p4673152.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: JAX-WS: Reading WSDL file from JAR file
I just tested this again because I remember at the time i used classpath:... in the wsdlLocation i saw error messages in the log file when booting up tomee. I have confirmed this just now but I have been ignoring this error message because it doesn't seem to stop my application from working properly. For my webservice annotated as follows... @Stateless @Local(AcceptPaymentForAncillariesPortType.class) @WebService( portName=AcceptPaymentForAncillariesPortType, serviceName=AcceptPaymentForAncillariesService, targetNamespace = urn:www.virginaustralia.com:service:contract:departure-management, endpointInterface=com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType, wsdlLocation=classpath:/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl ) public class AcceptPaymentForAncillariesImpl implements AcceptPaymentForAncillariesPortType { ... } When booting tomee, i get this error in the console... Dec 01, 2014 9:57:45 AM org.apache.openejb.config.WsDeployer getWsdl SEVERE: Unable to read wsdl file classpath:/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl Even though that message is SEVERE, it doesn't affect my application in any way. I just changed my wsdlLocation as follows... @Stateless @Local(AcceptPaymentForAncillariesPortType.class) @WebService( portName=AcceptPaymentForAncillariesPortType, serviceName=AcceptPaymentForAncillariesService, targetNamespace = urn:www.virginaustralia.com:service:contract:departure-management, endpointInterface=com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType, wsdlLocation=META-INF/wsdl/AcceptPaymentForAncillaries.wsdl ) public class AcceptPaymentForAncillariesImpl implements AcceptPaymentForAncillariesPortType { ... } Note the wsdlLocation path is relative. When i booted my application the error message no longer appears and the web service also works. If i change wsdlLocation to use an absolute path (wsdlLocation=/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl), the I get the error message... SEVERE: Unable to read wsdl file /META-INF/wsdl/AcceptPaymentForAncillaries.wsdl and my web service no longer works. In this case cxf also throws an exception... SEVERE: Error deploying JAX-WS Web Service for EJB AcceptPaymentForAncillariesImpl org.apache.cxf.service.factory.ServiceConstructionException: Service class com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType method AcceptPaymentForAncillaries part {urn:www.virginaustralia.com:service:contract:departure-management}request cannot be mapped to schema. Check for use of a JAX-WS-specific type without the JAX-WS service factory bean. So to summarize, I can use wsdlLocation=classpath:absolute_path_to_wsdl and my application works but i get a SEVERE: Unable to read wsdl file error message in the log file which i can seem to safely ignore. I can use wsdlLocation=relative_path_to_wsdl and it works and I get no SEVERE: Unable to read wsdl file error message. I cannot use wsdlLocation=absolute_path_to_wsdl. I get the SEVERE Unable to read wsdl file error message and also CXF throws an error when trying to construct the service. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-WS-Reading-WSDL-file-from-JAR-file-tp4670256p4673082.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: JAX-WS: Reading WSDL file from JAR file
Actually looks like i do still get the error message in the log file when using the relative path form of wsdlLocation... Dec 01, 2014 10:48:27 AM org.apache.openejb.config.WsDeployer getWsdl SEVERE: Unable to read wsdl file META-INF/wsdl/AcceptPaymentForAncillaries.wsdl Just missed it before but my application works regardless of this error message. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-WS-Reading-WSDL-file-from-JAR-file-tp4670256p4673083.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Please provide a working example for configuring any kind of resource-adapters in tomee!
rherschke wrote The problem isn't regarding the development of a JCA Resource Adapter, but about configuring and referencing it in Tomee. ... I see, that there is an undocumented way to create Per-App-Instances of a Resource via Resource ... class=... (rather than type=..., as documented at the Tomee Site). You don't need to do any configuration in resources.xml for a connection factory. The standard ra.xml file is all you need. If you have a war file, then you can put the ra.xml in the WEB-INF folder (this is where tomee leads the way by allowing packaging of resource adapters in war files). If you are packaging in a standard ear file, then you need a .rar file with the ra.xml packaged up inside of that. TomEE will create the resource and bind it to JNDI using ra.xml. To use a jca connection factory from a managed bean (eg. an ejb), you can get it using the @Resource annotation. The normal rules regarding @Resource apply. You don't need to specify the name in the @Resource annotation if the connection factory class is unique and tomee can resolve the dependency. The test case in the project i gave you a link to demonstrates how to inject a connection factory. That project wasn't about showing you how to develop a resource adapter, it was more to demonstrate how a resource adapter is instantiated and used from a test case. The same technique applies in a normal application. I've found when i've had issues with tomee features, the community here is very helpful. If you can identify a defect or a place where tomee doesn't properly implement the spec, then that will be immediately fixed. I'm not sure that is the case here. Regards, Anthony -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Please-provide-a-working-example-for-configuring-any-kind-of-resource-adapters-in-tomee-tp4673033p4673075.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: JAX-WS: Reading WSDL file from JAR file
This is interesting because I found i had to use classpath:... in wsdlLocation when i was setting up tomee to reuse a single JAXBContext like follows... @Stateless @Local(AcceptPaymentForAncillariesPortType.class) @WebService( portName=AcceptPaymentForAncillariesPortType, serviceName=AcceptPaymentForAncillariesService, targetNamespace = urn:www.virginaustralia.com:service:contract:departure-management, endpointInterface=com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType, wsdlLocation=classpath:/com/virginaustralia/service/contract/departure_management/AcceptPaymentForAncillaries.wsdl ) public class AcceptPaymentForAncillariesImpl implements AcceptPaymentForAncillariesPortType { ... } The thread related to this is here http://tomee-openejb.979440.n4.nabble.com/Use-single-JAXBContext-for-multiple-web-services-td4670019.html -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-WS-Reading-WSDL-file-from-JAR-file-tp4670256p4673080.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Please provide a working example for configuring any kind of resource-adapters in tomee!
I worked on a JCA adapter recently in tomee so know what you're going through. I created a very basic JCA skeleton project that contains a very simple jca adapter and a single test case that loads the resource adapter in tomee and injects the connection factory. You can see this project here... https://github.com/httpants/jcatest Also some other threads discussing tomee and jca that might help... http://openejb.979440.n4.nabble.com/openejb-not-destroying-ManagedConnections-on-shutdown-td4658799.html#a4658979 http://openejb.979440.n4.nabble.com/How-do-i-deploy-a-ManagedConnectionFactory-in-a-war-file-td4659993.html One feature of tomee that no other container has is the ability to package a rar in a war (non standard feature but extremely useful in some cases)! Other containers only support rar in ear. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Please-provide-a-working-example-for-configuring-any-kind-of-resource-adapters-in-tomee-tp4673033p4673064.html Sent from the TomEE Users mailing list archive at Nabble.com.
tomee and moxy
I have been trying to use moxy as the JAXBContext implementation in tomee and have had some issues. I had the following war file... moxy-test.war |-WEB-INF |-lib |-config-moxy.jar |- META-INF |- services |-javax.xml.bind.JAXBContext The content of the javax.xml.bind.JAXBContext file is org.eclipse.persistence.jaxb.JAXBContextFactory When i created a JAXBContext in my app, it was always creating an instance of com.sun.xml.bind.v2.runtime.JAXBContextImpl. I tried setting the following in system.properties... javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory but that also didn't work and still i was always getting an com.sun.xml.bind.v2.runtime.JAXBContextImpl instance. Lastly i tried moving config-moxy.jar into tomee/lib and finally i started getting instances of org.eclipse.persistence.jaxb.JAXBContext. Then i renamed config-moxy.jar to moxy-config.jar in tomee/lib and it stopped working. That's when i looked at the jars packaged in tomee/lib and found that jaxb-impl.jar has a META-INF/services/javax.xml.bind.JAXBContext file with the content com.sun.xml.bind.v2.ContextFactory which was causing all my JAXBContext instances to be of that type. I got lucky when i named my file config-moxy.jar in tomee/lib because it came before jaxb-impl.jar and configured moxy. I then deleted the META-INF/services folder from tomee/lib/jaxb-impl.jar and tested my original war file which had the config-moxy.jar in WEB-INF/lib and it started working. I was wondering, should jaxb-impl.jar have that META-INF/services/javax.xml.bind.JAXBContext file? It makes it very difficult to configure your own jaxb implementation from a war file. Also shouldn't the javax.xml.bind.context.factory system property override any jar file configuration? Regards, Anthony -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-and-moxy-tp4671723.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: tomee and moxy
I'm creating a jaxws client and want to use the same jaxbcontexts used to marshal the jaxb objects to xml to also marshal to json in a Handler for indexing the web service requests and responses in elastic search. The default JAXBContext can't marshal to json, so i need to use moxy. I tried using jackson (ie. not use a jaxbcontext at all) for serializing to json but when it came to deserialization from json to an object, it couldn't handle some cases (object inheritance etc). I found using moxy i could reuse the same jaxbcontext using by the dispatcher and it handled complex deserialization better than anything else. Wouldn't the container (and cxf) still use com.sun.xml.bind.v2.runtime.JAXBContextImpl even if you removed META-INF/services folder from tomee/lib/jaxb-impl.jar? I just need my deployed app to use moxy, not the container libs. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-and-moxy-tp4671723p4671726.html Sent from the TomEE Users mailing list archive at Nabble.com.
tomee-webprofile-1.7, cxf3 and jaxrs annotations
I'm have been trying out using cxf3 with apache-tomee-webprofile-1.7.0 and testing to see if i can create some jaxrs services. I've hit a problem when i use a jax-rs annotation. In my pom.xml i have this... dependency groupIdorg.apache.cxf/groupId artifactIdcxf-integration-cdi/artifactId version3.0.1/version /dependency I then create a jaxrs application class... @ApplicationPath(/api) public class BookStoreApplication extends Application { } and when I boot up the server i get errors... SEVERE: CDI Beans module deployment failed javax.enterprise.event.ObserverException: Caught Exception while handling event object with type : org.apache.webbeans.portable.events.discovery.AfterDeploymentValidationImpl at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:501) at org.apache.webbeans.container.BeanManagerImpl.fireEvent(BeanManagerImpl.java:446) at org.apache.webbeans.container.BeanManagerImpl.fireLifecycleEvent(BeanManagerImpl.java:436) at org.apache.webbeans.config.BeansDeployer.fireAfterDeploymentValidationEvent(BeansDeployer.java:374) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:205) at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:194) at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:160) at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:797) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:623) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1248) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1087) 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:5378) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(FutureTask.java:262) 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:744) Caused by: org.apache.webbeans.exception.WebBeansException: java.lang.reflect.InvocationTargetException at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:272) at org.apache.webbeans.event.NotificationManager.fireEvent(NotificationManager.java:482) ... 22 more Caused by: java.lang.reflect.InvocationTargetException 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 org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:266) ... 23 more Caused by: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map; at org.apache.cxf.jaxrs.utils.ResourceUtils.createApplication(ResourceUtils.java:799) at org.apache.cxf.cdi.JAXRSCdiResourceExtension.createFactoryInstance(JAXRSCdiResourceExtension.java:127) at org.apache.cxf.cdi.JAXRSCdiResourceExtension.load(JAXRSCdiResourceExtension.java:92) ... 28 more Could this be because cxf3 cdi integration requires cdi1.1 and tomee1.7 only supports cdi1.0? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-webprofile-1-7-cxf3-and-jaxrs-annotations-tp4671580.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Apache TomEE 1.7.0 Release
great work! -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Apache-TomEE-1-7-0-Release-tp4671162p4671201.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Application that contains jersey fails to start
MarkusFrisch wrote If so - what would you recommend as a replacement? You could always use apache cxf which is bundled with tomee. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Application-that-contains-jersey-fails-to-start-tp4671125p4671129.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Need a sample CXF web service creation steps
Are you using contract first (ie. you have the WSDL already and need to create the web service implementation for it), or code first (you have no WSDL and just want to write the code and generate the WSDL)? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Need-a-sample-CXF-web-service-creation-steps-tp4670917p4670944.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: TomEE OpenEJB IDE Support
Alexander Wagner wrote At this point our big question is the IDE Support. The Eclipse Support for Tomcat/TomEE over the WTP-Connector is excellent, but it covers only War-Projects. So I tried the OpenEJB Eclipse Plugin (https://openejb.apache.org/openejb-eclipse-plugin.html). First of all, it seems to work, but nevertheless it seems also a little bit outdated. Does someone has some real experiences with it, especially with debugging, workspace maven dependency resolution? I use eclipse with tomEE almost everyday. It has taken time to get eclipse working well, but now for me it is a great tool for developing applications. Eclipse maven support, m2e, takes some time to get used to, but when you do and you work out which additional m2e plugins you need, you can get eclipse to perform automatic builds using the maven build plugins. An example of some m2e plugins i use are... m2e connector for jaxws m2e connector for OpenJPA m2e connector for XML Transform I decided ages ago that packaging my applications in war files instead of ears wasn't a big deal. I wanted to use tomEE from eclipse and use the eclipse wtp to automatically publish my war into tomee. I could repackage into ear files later if i want to deploy into a different container that doesn't support skinny ears (ie. wars). I also setup my servers configed in eclipse to use a Dynamic Code Evolution VM (DCEVM) so class changes are just deployed into a running tomee instance automatically and debugging can be performed immediately after a code change is made (no need to redeploy the app and restart tomee and no need to pay for jrebel). Some info about this can be found here... http://javainformed.blogspot.com.au/2014/01/jrebel-free-alternative.html So in summary * I have a multi module maven pom project (I have 23 projects in my eclipse workspace all pure maven projects, no eclipse specific info in the pom.xml files). * My projects are all built automatically by eclipse when a code change is made because i installed the necessary m2e plugins. This includes changes to wsdl files, xsd files and jpa entities. * The classes generated by the eclipse maven builder are automatically published to my tomee server by eclipse wtp. * DCEVM automatically loads those classes into an already running server. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-OpenEJB-IDE-Support-tp4670731p4670733.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
Using the 2.7.X conduit from tomee-plus-1.6.0 is proving to be difficult. It seems ok if i'm not hosting any web services, but when i try it from a web service (ie. call an external web service from my own web service), then it throws lots of different types of exceptions (ClassNotFound etc). It would be nice to have a 1.6.0.3 version that uses cxf 2.7.11. Wonder how hard that would be? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670552.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
Romain Manni-Bucau wrote I'd like to get 2.0.x-alpha where we are neither javaee 7 nor certified but in between ee6 and 7 where we could have cxf 3 Sounds good. Lack of certification isn't a big issue for me compared to getting NIO capability for calling web services. After playing with the NIO client over the past few days, I'm now addicted and need to have it :) -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670554.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
Romain Manni-Bucau wrote Wonder if you can't simply use cxf 3/2.7 async conduit with cxf 2. It is theorytically possible, would need to check the modularity of cxf for it. I'll try this approach. I have another question related to this. I'm performing the webservice invokeAsync calls from a jca resource adapter managed connection. Can i use CDI to inject a javax.xml.ws.Service instance into a javax.resource.spi.ResourceAdapter or javax.resource.spi.ManagedConnectionFactory? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670535.html Sent from the TomEE Users mailing list archive at Nabble.com.
Is there a CXF Async thread pool?
I have a project running in tomee and i've just implemented using jax-ws asynchronous web service calls. Do jax-ws async calls use a different async thread pool to the pool configured using AsynchronousPool.CorePoolSize? Does cxf use nio by default for async web service calls? Thanks, Anthony -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
I might wait for tomee 1.7. That's coming soon right? :) -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670501.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
How do i configure the cxf async pool in tomee 1.6? I'm looking for the name of property similar to the AsynchronousPool.CorePoolSize that i can put in system.properties? -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670502.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Is there a CXF Async thread pool?
Sorry to ask but is there an expected release date for tomee 2.0? I can't use snapshot versions, so have to wait for the release. Also i'm using apache-tomee-plus so don't feel comfortable replacing the cxf version of the libs. -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Is-there-a-CXF-Async-thread-pool-tp4670492p4670507.html Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Use single JAXBContext for multiple web services
I implemented using the ResourceAsService wrapper as you suggested and it works. I think that ResourceAsService could be useful enough to be included in tomee. My ResourceAsService class is public class ResourceAsService { private String resourceId; public String getResourceId() { return resourceId; } public void setResourceId(String resourceId) { this.resourceId = resourceId; } public Object get() throws Exception { if (resourceId == null) { throw new IllegalArgumentException(Please specify a resourceId); } return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(openejb:Resource/ + resourceId); } } My resources.xml now looks like this... resources Resource id=myJAXBContextResource class-name=com.virginaustralia.service.GlobalJAXBContext factory-name=getJAXBContext/ Service id=myJAXBContextService class-name=au.com.cyberavenue.cxf.ResourceAsService factory-name=get resourceId = myJAXBContextResource /Service Service id=myJAXBDataBinding class-name=org.apache.cxf.jaxb.JAXBDataBinding constructor=jaxbContext jaxbContext = $myJAXBContextService /Service /resources And my GlobalJAXBContext class has gone back to this... public class GlobalJAXBContext { public static JAXBContext getJAXBContext() { try { return JAXBContext.newInstance(new Class[] { com.virginaustralia.model.schema.utility.ObjectFactory.class, com.virginaustralia.service.contract.departure_management.ObjectFactory.class }); } catch (JAXBException e) { e.printStackTrace(); } return null; } } and everything boots up quickly like before. Thanks for the suggestion. As for documentation...i would if i get time from my project. Is there documention on how to contribute? -- View this message in context: http://openejb.979440.n4.nabble.com/Use-single-JAXBContext-for-multiple-web-services-tp4670019p4670024.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Use single JAXBContext for multiple web services
Using @resourceId would be even better. I was wishing for that the last few days. Cheers, Anthony -- View this message in context: http://openejb.979440.n4.nabble.com/Use-single-JAXBContext-for-multiple-web-services-tp4670019p4670026.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Use single JAXBContext for multiple web services
I've managed (after lots of pain and suffering) to get my web services using the same JAXBContext. The great thing is this significantly speeds up my tomee boot time. Before, tomee was taking 37594 ms to boot and now it is taking 10150 ms, so the performance gain is massive. The steps i went through to get this to work are detailed below. I tried to follow the steps described in https://www.mail-archive.com/users@cxf.apache.org/msg35563.html, changing the spring config into tomee config. So the idea was to try to create a global JAXBContext instance and then pass that as a constructor parameter into the org.apache.cxf.jaxb.JAXBDataBinding. I thought I could do this using Service elements in my resources.xml file. I created a class to create the JAXBContext... public class GlobalJAXBContext { public static JAXBContext getJAXBContext() { try { return JAXBContext.newInstance(new Class[] { com.virginaustralia.model.schema.utility.ObjectFactory.class, com.virginaustralia.service.contract.departure_management.ObjectFactory.class }); } catch (JAXBException e) { e.printStackTrace(); } return null; } } Then I added the following to my resources.xml... resources ... Service id=myJAXBContext class-name=com.virginaustralia.service.GlobalJAXBContext factory-name=getJAXBContext/ Service id=myJAXBDataBinding class-name=org.apache.cxf.jaxb.JAXBDataBinding constructor=jaxbContext jaxbContext = $myJAXBContext /Service /resources Took me a long time and looking through source code to discover you can pass other services as a constructor parameter using the $serviceId notation. My openejb-jar.xml then looked like this... openejb-jar xmlns=http://www.openejb.org/openejb-jar/1.1; ejb-deployment ejb-name=AcceptPaymentForAncillariesImpl properties cxf.jaxws.databinding = myJAXBDataBinding /properties /ejb-deployment ejb-deployment ejb-name=ActivatePassengerBagTagImpl properties cxf.jaxws.databinding = myJAXBDataBinding /properties /ejb-deployment ... plus 30 other services similar to above /openejb-jar Booting tomee after this change is where the errors started happening. First error was this one... org.apache.cxf.service.factory.ServiceConstructionException: Service class com.virginaustralia.service.contract.departure_management.DeletePassengerBagTagPortType method deletePassengerBagTag part {urn:www.virginaustralia.com:service:contract:departure-management}request cannot be mapped to schema. Check for use of a JAX-WS-specific type without the JAX-WS service factory bean. To fix this, i had to specify the wsdlLocation in the @WebService annotation. Fortunately you can do this using a classpath url (this requires you to package the WSDL with the service and port classes generated using wsimport). @Stateless @Local(AcceptPaymentForAncillariesPortType.class) @WebService( portName=AcceptPaymentForAncillariesPortType, serviceName=AcceptPaymentForAncillariesService, targetNamespace = urn:www.virginaustralia.com:service:contract:departure-management, endpointInterface=com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType, wsdlLocation=classpath:/com/virginaustralia/service/contract/departure_management/AcceptPaymentForAncillaries.wsdl ) public class AcceptPaymentForAncillariesImpl implements AcceptPaymentForAncillariesPortType { ... } After adding wsdlLocation to every service, I booted tomee, but the boot time was exactly the same. Turns out that a new instance of the myJAXBDataBinding service defined in resources.xml was being instantiated for every web service. And since i used the myJAXBContext as a constructor argument, a new JAXBContext was being created for every service and consequently i was no better off than before. I only wanted a single JAXBContext created, so I tried to configure it as a Resource instead of a Service as below... resources ... Resource id=myJAXBContext class-name=com.virginaustralia.service.GlobalJAXBContext factory-name=getJAXBContext/ Service id=myJAXBDataBinding class-name=org.apache.cxf.jaxb.JAXBDataBinding constructor=jaxbContext jaxbContext = $myJAXBContext /Service /resources Unfortunately when i tried that, the $myJAXBContext being passed as a constructor parameter was null. Is there a way you can pass a resource to a service as a constructor parameter? To get around this, I had to change the Resource back to being a Service and modify my class that creates the JAXBContext to only return a singleton instance... public class GlobalJAXBContext { private static JAXBContext
Use single JAXBContext for multiple web services
Is it possible to configure a single JAXBContext to be reused by multiple JAX-WS web services? I want to test this to see if it speeds up my boot time and uses less memory. Searching on the web, i've found this link... https://www.mail-archive.com/users@cxf.apache.org/msg35563.html This suggests that it might be possible by configuring a dataBinding property in cxf jaxws. Is this property able to be configured in tomee? On a side note, to me it looks like JAX-RS and JAX-WS use different strategies for JAXBContexts. In my project, JAX-RS had marshalling issues if the ObjectFactory class didn't contain all required jaxb elements, but JAX-WS didn't fail in that case. But then JAX-RS seems to boot up much faster than JAX-WS which i'm pretty sure is related to JAXBContext creation. -- View this message in context: http://openejb.979440.n4.nabble.com/Use-single-JAXBContext-for-multiple-web-services-tp4670019.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: cxf advanced examples
I was hoping there was more to it than that. Like being able to inject interceptors and do away with config in resources.xml and openejb-jar.xml. -- View this message in context: http://openejb.979440.n4.nabble.com/cxf-advanced-examples-tp4669927p4669937.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: cxf advanced examples
I know you're right and usually at some point we have to configure something that is specific to an implementation. -- View this message in context: http://openejb.979440.n4.nabble.com/cxf-advanced-examples-tp4669927p4669942.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: cxf advanced examples
Hwaastad, just interested to know where you are? I used to live in Switerland and going snowboarding in the swiss and french alps. Your pic looks like that. Am i close? -- View this message in context: http://openejb.979440.n4.nabble.com/cxf-advanced-examples-tp4669927p4669947.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: cxf advanced examples
I have a simple cxf interceptor in a project that just forces the text of an xml element in a web service response to be wrapped in a CDATA element. It would probably make for a good example. There's 2 classes I have to implement the interceptor... public class CDataContentWriter extends DelegatingXMLStreamWriter { private static final Pattern XML_CHARS = Pattern.compile([]); private String currentElementLocalName; public CDataContentWriter(XMLStreamWriter writer) { super(writer); } @Override public void writeCharacters(String text) throws XMLStreamException { boolean useCData = XML_CHARS.matcher(text).find(); if (useCData) { super.writeCData(text); } else { super.writeCharacters(text); } } @Override public void writeStartElement(String prefix, String local, String uri) throws XMLStreamException { currentElementLocalName = local; super.writeStartElement(prefix, local, uri); } } public class CDataWriterInterceptor extends AbstractPhaseInterceptorMessage { public CDataWriterInterceptor() { super(Phase.PRE_STREAM); addAfter(AttachmentOutInterceptor.class.getName()); } @Override public void handleMessage(Message message) throws Fault { message.put(disable.outputstream.optimization, Boolean.TRUE); XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(message.getContent(OutputStream.class)); message.setContent(XMLStreamWriter.class, new CDataContentWriter(writer)); } } Then in my resources.xml (or you could use tomee.xml) i declare the interceptor as a service... resources Service id=cdataWriterInterceptor class-name=au.com.cyberavenue.cxf.CDataWriterInterceptor/ /resources Lastly, I had to create an openejb-jar.xml (located in my WEB-INF folder) which is where i hook up the interceptor service to individual web services... openejb-jar xmlns=http://www.openejb.org/openejb-jar/1.1; ejb-deployment ejb-name=GetBoardingPassDataImpl properties cxf.jaxws.out-interceptors = cdataWriterInterceptor /properties /ejb-deployment ejb-deployment ejb-name=BoardingPassBarCodeImpl properties cxf.jaxws.out-interceptors = cdataWriterInterceptor /properties /ejb-deployment /openejb-jar So I ended up with 2 webservices where the response xml will have CDATA elements instead of escaped strings. Hope this helps. Regards, Anthony -- View this message in context: http://openejb.979440.n4.nabble.com/cxf-advanced-examples-tp4669927p4669928.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Web Services slow down boot time
It might be related to jaxb context initialization since i have 274 jaxb classes. -- View this message in context: http://openejb.979440.n4.nabble.com/Web-Services-slow-down-boot-time-tp4669495p4669574.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Web Services slow down boot time
I just thought i would mention that i have noticed when booting tomEE, initialization of EJBs is really quick, but when my web services initialize in the container, they take about 1 second each. I have a project with about 17 web services and now i'm really noticing the web service initialization time. I'm using apache-tomee-plus-1.6.0. -- View this message in context: http://openejb.979440.n4.nabble.com/Web-Services-slow-down-boot-time-tp4669495.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Web Services slow down boot time
It's JAXWS -- View this message in context: http://openejb.979440.n4.nabble.com/Web-Services-slow-down-boot-time-tp4669495p4669534.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Web Services slow down boot time
I don't have a post construct. Here's some of the console log output showing the webservices being deployed. From the timestamp, you can see the StartEjbs is really quick (all ejbs start in about 1 second) and then the org.apache.openejb.server.webservices.WsService deployApp is noticably slower (on the machine where i got this log file, its about 0.5 seconds per service, on my laptop it's 1 second per service). It's not a huge problem but would be nice if it could be faster. May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=DeletePassengerBagTagImpl, ejb-name=DeletePassengerBagTagImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetPassengerDataImpl, ejb-name=GetPassengerDataImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=EditPassengerDataImpl, ejb-name=EditPassengerDataImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=FindReservationForCheckInImpl, ejb-name=FindReservationForCheckInImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=BoardingPassBarCodeImpl, ejb-name=BoardingPassBarCodeImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=CheckInPassengerImpl, ejb-name=CheckInPassengerImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=IdentifyPassengerForBagDropImpl, ejb-name=IdentifyPassengerForBagDropImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=CheckInUtility, ejb-name=CheckInUtility, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=ChangeSeatsImpl, ejb-name=ChangeSeatsImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=IdentifyPassengerForKioskImpl, ejb-name=IdentifyPassengerForKioskImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=AirportServiceImpl, ejb-name=AirportServiceImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetSeatMapImpl, ejb-name=GetSeatMapImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=EditPassengerTravelDocsImpl, ejb-name=EditPassengerTravelDocsImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetAirportFlightDestinationsImpl, ejb-name=GetAirportFlightDestinationsImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=IssuePassengerBagTagsImpl, ejb-name=IssuePassengerBagTagsImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=AirportDAO, ejb-name=AirportDAO, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=OffloadPassengerImpl, ejb-name=OffloadPassengerImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetFlightDetailImpl, ejb-name=GetFlightDetailImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetBoardingPassDataImpl, ejb-name=GetBoardingPassDataImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=BagTagDAO, ejb-name=BagTagDAO, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=GetBagAncillaryPriceListImpl, ejb-name=GetBagAncillaryPriceListImpl, container=My Stateless Container) May 22, 2014 12:25:47 PM org.apache.openejb.assembler.classic.Assembler startEjbs INFO: Created Ejb(deployment-id=EditPassengerBagTagImpl, ejb-name=EditPassengerBagTagImpl, container=My Stateless Container) May 22, 2014 12:25:47
Re: Java Application Servers are Dead
I think Java Application Servers left a bad impression on alot of people back in the early ejb2/jsf1 days. It wasn't only the specs that were not great (ie. ejb2 entity beans) but also the containers that were implemented were incredibly resource hungry memory pigs that took an eternity to boot up. I remember working on weblogic 8 which you couldn't run on a machine with 2Gb and when you booted it, you could walk away and make a coffee, come back and if you were lucky it would have started. Back then alot of people looking for a better way to do things went to spring and the spring, (tomcat|jetty), hibernate stack became really popular. Jee was abandoned by alot of developers. Over the last few years with the jee spec improving massively (esp ejb3 and jsf2) , the introduction of CDI and the development of new super lightweight fast jee containers (tomee by far consumes the least memory in my experiences and boots up in a matter of seconds), in my opinion jee has definately leaped ahead of the spring, tomcat, hibernate stack. Also its a STANDARD so you get a warm fuzzy feeling knowing that it's a technology that's not going to dissappear just because its not flavour of the month at any point in time. The problem these days is the people that left jee before and went to spring are stuck in their ways and still think jee is bad and containers are fat and bloated. Most people haven't bothered to look again. Most java devs when I mention dependency injection think only of spring. I'm amazed how many don't even know about CDI. There's new projects using spring to create web services. When i asked if they looked at JAX-WS i get blank stares back. I think there's a big education issue with java devs stuck in their ways and too lazy to learn something new. -- View this message in context: http://openejb.979440.n4.nabble.com/Java-Application-Servers-are-Dead-tp4669233p4669237.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: TomEE performance degrades gradually
Hi Ivan, I duplicated your results using the test case you uploaded and saw a steady performance degredation. I was wondering if this was related to jpa, or the fact you're using ejb2, so i created a similar test case using ejb 3 entity beans, based on the injection-of-entitymanager test case. My test case is here... injection-of-entitymanager.zip http://openejb.979440.n4.nabble.com/file/n4668673/injection-of-entitymanager.zip Thankfully, i'm not seeing the same issue using ejb 3, so it looks like the problem is isolated to the use of ejb2 cmp entity beans. -- View this message in context: http://openejb.979440.n4.nabble.com/TomEE-performance-degrades-gradually-tp4668090p4668673.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: it is possible put persistence.xml into a jar indipendent that use into a web application?
You can create a persistence.xml in your WEB-INF folder and reference jar files in your WEB-INF/lib using the jar-files element. I normally put jar files into WEB-INF/lib and put persistence.xml in /META-INF of those jar files. You could create a remote ejb interface and pass your entity classes as method parameters if you wanted to since they are serializable. In the ejb method you could do an em.merge(...) to attach the object to the entity manager. Anthony -- View this message in context: http://openejb.979440.n4.nabble.com/it-is-possible-put-persistence-xml-into-a-jar-indipendent-that-use-into-a-web-application-tp4667958p4667959.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Changing the URL for SOAP @WebService
This might help... http://openejb.979440.n4.nabble.com/TomEE-CXF-Configuration-td4631682.html#a4651270 -- View this message in context: http://openejb.979440.n4.nabble.com/Changing-the-URL-for-SOAP-WebService-tp4667258p4667260.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: When will MyFaces 2.2.x be bundled with TomEE 1.6.x ?
+1 Stateless views will be nice. -- View this message in context: http://openejb.979440.n4.nabble.com/When-will-MyFaces-2-2-x-be-bundled-with-TomEE-1-6-x-tp4667185p4667194.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: stateless bean pool -- all beans not available? / async business method causes problem
So there's a sync thread pool (ie. when called by a HttpServletRequest) and if that thread calls a stateless session EJB method synchronously, it uses that same thread and is only limited by the stateless session pool size. If an async call is made, then is uses the async thread pool (default size 3) and then if that thread calls an EJB method, it will take that EJB instance from the same EJB pool as the sync thread? I think what i'm trying to ask is that the stateless session pool size of 100 will be used across both sync and async thread pools? The problem here is that the async thread pool size is only 3. Is that correct? Cheers, Anthony -- View this message in context: http://openejb.979440.n4.nabble.com/Re-stateless-bean-pool-all-beans-not-available-async-business-method-causes-problem-tp4667020p4667034.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: stateless bean pool -- all beans not available? / async business method causes problem
Interesting to know that there are separate sync and async pools. I would have assumed that you would configure a pool for stateless session beans that would be used for both sync and async. But i can see that could cause potential thread deadlocks so you need a dedicated async thread pool. But maybe the async pool could use sync pool instances and also have an additional async only pool that can be used in addition to the sync pool only if all sync pool instances are in use? Hope that makes sense to someone. -- View this message in context: http://openejb.979440.n4.nabble.com/Re-stateless-bean-pool-all-beans-not-available-async-business-method-causes-problem-tp4667020p4667032.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: doubt about scopes
Could it be because you're using JSF managed beans instead of CDI? -- View this message in context: http://openejb.979440.n4.nabble.com/doubt-about-scopes-tp4666709p4666726.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Looking for some advice about EJB, JMS and Quartz with TomEE+ 1.6.0
Maybe move your jms consumers into a different app from your webapp? -- View this message in context: http://openejb.979440.n4.nabble.com/Looking-for-some-advice-about-EJB-JMS-and-Quartz-with-TomEE-1-6-0-tp4666342p4666359.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Looking for some advice about EJB, JMS and Quartz with TomEE+ 1.6.0
Leonardo K. Shikida wrote Last but not least, I've experiencing some strange problems probably related to the classloader, and I've removed xerces-impl-2.11.0.jar from eclipse factory path (java compiler - annotation processing - factory path, to generate openJPA metamodel classes for Criteria using openjpa.metamodel=true). I am adding all tomee jars, but I would like to restrict to the barely necessary classes. I am using oracle JVM 7. I don't know how you have your tomee server setup in eclipse but you shouldn't have to do that at all. A really good eclipse plugin if you use maven and openjpa enhancement is ​https://github.com/hwellmann/m2eclipse-extras/raw/master/p2/. That will enhance your jpa classes within eclipse even when you execute junit test cases. -- View this message in context: http://openejb.979440.n4.nabble.com/Looking-for-some-advice-about-EJB-JMS-and-Quartz-with-TomEE-1-6-0-tp4666342p4666360.html Sent from the OpenEJB User mailing list archive at Nabble.com.
tomee 1.6.0 plus error deploying app with jax-rs
I've just deployed an application that i had running in tomee1.5.2 into tomee 1.6.0. When the application starts up, i get the following error printed out to the console that i didn't get when deploying to tomee 1.5.2. Any ideas what might be causing this? 25/11/2013 3:28:13 PM org.apache.openejb.server.rest.RESTService logOldDeploymentUsage INFO: Using deployment by endpoint instead of by application for JAXRS deployment because an old configuration (by class/ejb) was found on com.thc.lc.rest.system.GroupService 25/11/2013 3:28:14 PM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO: Using providers [com.thc.lc.rest.EJBExceptionMapper@6bcedaf2, org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider@59887d29, com.thc.lc.rest.DateParameterHandler@fd13cab, com.thc.lc.rest.JsonProvider@71e606a9, com.thc.lc.rest.LCExceptionMapper@34bf7baa] 25/11/2013 3:28:14 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be http://localhost:8080/LemonadeCloud 25/11/2013 3:28:14 PM org.apache.openejb.server.rest.RESTService deployPojo INFO: REST Service: http://localhost:8080/LemonadeCloud/service/group/* - Pojo com.thc.lc.rest.system.GroupService 25/11/2013 3:28:14 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be http://localhost:8080/LemonadeCloud 25/11/2013 3:28:14 PM org.apache.openejb.observer.ObserverManager fireEvent SEVERE: error invoking Observer{class=org.apache.tomee.webservices.TomeeJaxRsService} org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:194) at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deploy(CxfRsHttpListener.java:291) at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployPojo(CxfRsHttpListener.java:248) at org.apache.openejb.server.rest.RESTService.deployPojo(RESTService.java:712) at org.apache.openejb.server.rest.RESTService.fullServletDeployment(RESTService.java:409) at org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:276) at org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51) 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.observer.ObserverManager$Observer.invoke(ObserverManager.java:149) at org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:69) at org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:108) at org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1600) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:113) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.RuntimeException: Already a destination on http://localhost:8080/LemonadeCloud at org.apache.cxf.transport.http.DestinationRegistryImpl.addDestination(DestinationRegistryImpl.java:49) at org.apache.cxf.transport.http.AbstractHTTPDestination.activate(AbstractHTTPDestination.java:853) at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49) at org.apache.cxf.binding.AbstractBaseBindingFactory.addListener(AbstractBaseBindingFactory.java:97) at org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:89) at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:131) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:185) ... 26 more -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-1-6-0-plus-error-deploying-app-with-jax-rs-tp4666376.html Sent from the OpenEJB User mailing list
Re: TransactionAttribute
I think it is because TransactionAttributeType.REQUIRED is the default used if you don't specify anything. -- View this message in context: http://openejb.979440.n4.nabble.com/TransactionAttribute-tp4665000p4665001.html Sent from the OpenEJB User mailing list archive at Nabble.com.
WebServiceRef injection of CXF configured jax-ws client
I was wondering if it is possible to inject a cxf jax-ws client using the @WebServiceRef annotation? My scenario is that there is a web service that is running in an external system that i want to call from a stateless ejb. I have run wsimport over the WSDL to generate the service (@WebServiceClient) and port (@WebService) classes and packaged them up into a jar file. In my stateless ejb, i am using @WebServiceRef to inject a reference to the generated service class. This works ok if i want a standard reference injected, but if i want to start configuring some things, like the endpoint address or ws-security, i'm coding these things, which i don't want to do. I think there must be a way to configure cxf to do what i'm doing programatically and have the @WebServiceRef inject a configured service reference. My ejb looks like this... @Stateless public class CreateLoyaltyAccountServiceImpl implements CreateLoyaltyAccountService { @WebServiceRef @HandlerChain(file=/META-INF/web-service/virgin/client-handler-chain.xml) MemberProfileMediatorService memberProfileService; MemberProfileMediatorPpt memberProfilePort; @PostConstruct private void postConstruct() { memberProfilePort = memberProfileService.getMemberProfileMediatorServicePort(); MapString, Object ctx = ((BindingProvider)memberProfilePort).getRequestContext(); ctx.put(ws-security.username, f); ctx.put(ws-security.password, *); } } You can see above i'm using postConstruct to do configure the ws-security of the webservice interface. Is it possible to have a cxf config file to do this? Something similar to below (with more properties than what i have below to configure security and other things)... ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; jaxws:client id=memberProfileService serviceClass=MemberProfileMediatorService address=http://localhost:8080/MemberProfileMediatorService; name=memberProfileService/ /beans One other minor thing that i have noticed while unit testing in openejb, i have to specify the openejb.embedded.remotable = true property for @WebServiceRef to work, even though i'm not actually hosting any service implementations, only the client references. Why is it necessary to enable remotable in this case? I think it is initializing cxf perhaps? -- View this message in context: http://openejb.979440.n4.nabble.com/WebServiceRef-injection-of-CXF-configured-jax-ws-client-tp4664824.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: WebServiceRef injection of CXF configured jax-ws client
It may be that I don't understand @WebServiceRef very well, but I don't see much value in using it in my case. If I still have to programmatically configure endpoint address and security headers I think I might be better off using @Produces method to return a configured SEI. Am I missing something about the @WebServiceRef annotation that is important? -- View this message in context: http://openejb.979440.n4.nabble.com/WebServiceRef-injection-of-CXF-configured-jax-ws-client-tp4664824p4664840.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Question on deploying custom JCA Resource Adapter to TomEE.
I worked on a JCA adapter recently and got it running in weblogic and tomee. some links that might help... http://openejb.979440.n4.nabble.com/openejb-not-destroying-ManagedConnections-on-shutdown-td4658799.html#a4658979 http://openejb.979440.n4.nabble.com/How-do-i-deploy-a-ManagedConnectionFactory-in-a-war-file-td4659993.html https://github.com/httpants/jcatest one cool feature of tomee that no other container has Is the ability to package a rar in a war (non standard feature but extremely useful in some cases)! Other containers only support rar in ear. -- View this message in context: http://openejb.979440.n4.nabble.com/Question-on-deploying-custom-JCA-Resource-Adapter-to-TomEE-tp4664830p4664841.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: My favorite exception message
Leonardo K. Shikida wrote that's probably because I am running tomEE from inside eclipse, and its configuration is messing the class loading process Running tomee inside eclipse should work exactly the same as outside eclipse but you may need the right plugins depending on how you build things. First thing would be to check which jar files eclipse WTP is publishing to the WEB-INF/lib folder in .metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\your web app\WEB-INF\lib. If the active mq lib is in there, then something is not quite right with how eclipse wtp or your build is setup. In the past i had issues when using maven to build my project with some 'provided' scoped jar files appearing in the WEB-INF/lib folder which were resolved when i installed the m2e-wtp plugin. Just mentioning that in case you have a similar issue. I now use eclipse with tomee everyday and WTP is creating identical war files now to what a mvn clean install does, so i completely trust it. m2e and m2e-wtp has improved massively over the past 18 months. Cheers, Anthony -- View this message in context: http://openejb.979440.n4.nabble.com/My-favorite-exception-message-tp4664726p4664736.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Further MySQL woes - possible timeouts again
Maybe try the autoReconnect=true option at the end of the JdbcUrl eg. Resource id=MySQL Database type=DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/lemonadeStand?autoReconnect=true UserName lc Password lc JtaManagedtrue MaxActive 10 MaxIdle 5 MinIdle 5 TimeBetweenEvictionRunsMillis 60 NumTestsPerEvictionRun5 ValidationQuery select 1 TestWhileIdle true /Resource -- View this message in context: http://openejb.979440.n4.nabble.com/Further-MySQL-woes-possible-timeouts-again-tp4664233p4664236.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: how to get mail session from JNDI
You should be able to inject the mail session directly into your unit test. I have a unit test that accesses the mail session through injection. It looks like this... public class EmailServiceEJBTest { final static Logger logger = LoggerFactory.getLogger(EmailServiceEJBTest.class); final static String DATABASE_DRIVER = org.hsqldb.jdbcDriver; final static String DATABASE_URL= jdbc:hsqldb:mem:pokersquid; static SimpleSmtpServer smtpServer; static EJBContainer ejbContainer; private static boolean databaseInitialized = false; @Resource(name=smtpSession) public Session smtpSession; @BeforeClass public static void beforeClass() { smtpServer = SimpleSmtpServer.start(29876); Properties p = new Properties(); // SMTP properties p.put(smtpSession, new://Resource?type=javax.mail.Session); p.put(smtpSession.mail.transport.protocol, smtp); p.put(smtpSession.mail.smtp.host, localhost); p.put(smtpSession.mail.smtp.port, 29876); p.put(smtpSession.mail.smtp.auth, false); ejbContainer = EJBContainer.createEJBContainer(p); } @AfterClass public static void afterClass() { ejbContainer.close(); smtpServer.stop(); } @Test public void testSendSimpleEmail() { assertNotNull(smtpSession); assertNotNull(emailService); emailService.sendMail( x...@yyy.com, test, this is a test email, text/plain); assertEquals(1, smtpServer.getReceivedEmailSize()); IteratorSmtpMessage iter = smtpServer.getReceivedEmail(); SmtpMessage email = iter.next(); assertEquals(test, email.getHeaderValue(Subject)); assertEquals(this is a test email, email.getBody()); } } -- View this message in context: http://openejb.979440.n4.nabble.com/how-to-get-mail-session-from-JNDI-tp4664156p4664205.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: how to get mail session from JNDI
forgot to post the @Before method, which is important... @Before public void before() throws NamingException, LiquibaseException, SQLException { ejbContainer.getContext().bind(inject, this); } -- View this message in context: http://openejb.979440.n4.nabble.com/how-to-get-mail-session-from-JNDI-tp4664156p4664206.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: TomEE plans for Java EE 7
Can't wait for JSR 352 Batch Applications for the Java Platform. Looks very much like spring batch which i have used and thought was one of the best spring modules that had no equivalent in jee. -- View this message in context: http://openejb.979440.n4.nabble.com/TomEE-plans-for-Java-EE-7-tp4663386p4663402.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Question on MDB processing
It would be nice to know how you have ActiveMQ configured when you get these sorts of issues. Are you using in-memory, file or rdbms persistence store? -- View this message in context: http://openejb.979440.n4.nabble.com/Question-on-MDB-processing-tp4661685p4661742.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Security issue using arquillian-tomee-embedded
Thanks for fixing this in 1.6.0. Any idea when that version will be released? For version 1.5.1, i have tried setting the openejb.provider.default property as you suggested but it hasn't fixed the problem. My arquillian.xml file is... arquillian xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd; container qualifier=tomee default=true configuration property name=httpPort19876/property property name=stopPort19875/property property name=version1.5.1/property property name=classifierplus/property property name=openejb.provider.defaultorg.apache.tomee/property /configuration /container /arquillian Is it possible to get this working with 1.5.1? -- View this message in context: http://openejb.979440.n4.nabble.com/Security-issue-using-arquillian-tomee-embedded-tp4661417p4661463.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to configure JacksonJsonProvider in resources.xml?
I found this link which describes a similar configuration of a JacksonJsonProvider but using spring... http://wolfe.id.au/2011/05/22/using-jackson-with-apache-cxf/ -- View this message in context: http://openejb.979440.n4.nabble.com/How-to-configure-JacksonJsonProvider-in-resources-xml-tp4661412p4661413.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Security issue using arquillian-tomee-embedded
I have a test case using tomee-embedded and have some jaxrs services configured to have basic authentication in web.xml. When i try to logon in my test case, I get the following exception... java.lang.ClassCastException: org.apache.openejb.core.security.SecurityServiceImpl cannot be cast to org.apache.tomee.catalina.TomcatSecurityService org.apache.tomee.catalina.TomEERealm.logInTomEE(TomEERealm.java:96) org.apache.tomee.catalina.TomEERealm.authenticate(TomEERealm.java:43) org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.java:662) If i deploy the war file into my stand alone tomee server it works fine. My pom.xml is below... project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd; modelVersion4.0.0/modelVersion parent groupIdcom.thc.lc/groupId artifactIdlemonade-cloud-parent/artifactId version1.0-SNAPSHOT/version /parent artifactIdlemonade-cloud-app/artifactId packagingwar/packaging namelemonade-cloud-app/name descriptionThe actual web application. This project would contain all the html, jsp and javascript. This would be deployed by the application container (tomee, glassfish, weblogic etc) and make use of the servlets and jax-rs classes in the lemonade-cloud-web layer./description properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding openejb.version4.5.1/openejb.version tomee.version1.5.1/tomee.version arquillian.version1.0.3.Final/arquillian.version tomee.classifierjaxrs/tomee.classifier /properties dependencyManagement dependencies dependency groupIdorg.jboss.arquillian/groupId artifactIdarquillian-bom/artifactId version1.0.3.Final/version scopeimport/scope typepom/type /dependency /dependencies /dependencyManagement dependencies dependency groupIdcom.thc.lc/groupId artifactIdlemonade-cloud-web/artifactId version1.0-SNAPSHOT/version /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.10/version scopetest/scope /dependency dependency groupIdorg.jboss.arquillian.junit/groupId artifactIdarquillian-junit-container/artifactId scopetest/scope /dependency dependency groupIdorg.jboss.shrinkwrap.resolver/groupId artifactIdshrinkwrap-resolver-impl-maven/artifactId scopetest/scope /dependency dependency groupIdorg.apache.openejb/groupId artifactIdziplock/artifactId version${tomee.version}/version scopetest/scope /dependency dependency groupIdorg.apache.openejb/groupId artifactIdarquillian-tomee-embedded/artifactId version${tomee.version}/version scopetest/scope /dependency dependency groupIdorg.apache.openejb/groupId artifactIdopenejb-core/artifactId version${openejb.version}/version scopetest/scope /dependency dependency