Spring bean not injected in CXF Restful Service on JBoss6 - spring

I am writing a CXF Restful service with Spring on JBoss 6. The Spring bean is not injected. Instead of showing gobs of code here, I have shared a sample project here. My understanding is that the spring context is not creating the rest service class and hence the spring bean (CoreService in the project) is not injected. However the same works well in TomCat. I want to get it working on JBoss6.
Please share your thoughts and help me resolve the issue. Your help highly appreciated. Thanks.

Related

Apache CXF JAX-WS spring-boot starter very slow

I'm working on a spring-boot application which has 100+ JAX-WS endpoints. I'm using apache CXF and the boot time performance is terrible. It takes more than 10 mins to publish 100 endpoints.
I tried to enable debug logs and see that cxf is creating a new JAXBContext instance for every endpoint. I tried to find material to configure single JAXBContext but none of the available material show properly how I can do it.
FYI: I'm using JavaFirst approach here.
Any suggestions to improve boot time performance are welcome.
Thanks,
Sriram
For JAX-WS please look at this existing question: Reuse CXF jaxb context between multiple services
Instead of declaring it using XML you can also add the bean for org.apache.cxf.jaxb.JAXBDataBinding using the #Bean annotation.
In case someone is looking for JAX-RS, this is handled differently. You need to add a bean for org.apache.cxf.jaxrs.provider.JAXBElementProvider and set singleJaxbContext to true as written in the docs: http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-SingleJAXBContextandextrauserclasses

Injecting Spring managed beans in EJBs and injecting EJBs in Spring Controllers

I am getting NullpointerException when calling EJB
Issue relates more to ways of configuring EJBs so that they can be injected in spring Controllers and Injecting Service classes into EJBs.
Make sure all beans defined are known to spring application context
A work around to injecting beans in EJBs is to use #PostContruct, this is the only way I could get everything working but a better example of a working setup could be more appreciated.

Bootstrapping and Configuring Spring. Difference between Configuring ApplicationContext in JavaSE and JavaEE

I am learning Spring framework, and getting an application context is really hard to understand for me. I understand that Bootstrapping Spring in JavaEE and JavaSE is different. I have bootstrapped my application using XML. Now I am not sure how and where to get the application context. I have done it in Servlet's config method for now. The problem with that is, I can't access that context outside of config. I really need some education on this ApplicationContext topic. Is it right to assume that ApplicationContext is a handle by which we can access beans in xml file from Java Code?
Thanks.

Intellij spring boot integration

For some reason Intellij 13.1.3 doesn't detect the spring boot beans. Spring boot version is 1.1.1-Release. When i try to inject ObjectMapper in some component i get an error in the IDE "No bean of type ObjectMapper defined", however the application compiles and runs just fine and the ObjectMapper beans is visible in the /beans json.
I have added my application-context and my Application.java files to a spring facet and the IDE recognizes all my other beans that I manually defined, it just ignores the ones that come with Spring boot #EnableAutoConfiguration. Any idea how to solve that since its kinda tedious not to have the correct linking in the IDE and get errors all over the place. I would assume thats a common issue?
Thanks!
As an update for this answer: IntelliJ now supports Spring Boot. Must be at least R14. R15 is including some more integration.
Spring Boot is not supported yet, please watch http://youtrack.jetbrains.com/issue/IDEA-119230

Injecting client proxy in JSF Bean

In my project, Web services are implemented using JAX WS - RI.
I want to call the web service methods from the JSF managed beans.
I mean to say I require the spring injection of client proxy in the managed bean.
For CXF i have read that we can use jaxws:client tag in the spring application context xml.
But for JAXWS RI I have no idea.
Any idea how can i do that?
For this you need to include the following preamble at the top of your Spring XML configuration file
xsi:schemaLocation="http://jax-ws.java.net/spring/servlet
http://jax-ws.java.net/spring/servlet.xsd"
and use the WebServiceServlet(WSS) tags.
More Info: link

Resources