aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Run correctly a Spring App on JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Run correctly a Spring App on JBoss" Watch "Run correctly a Spring App on JBoss" New topic
Forums: Spring Other JSE/JEE APIs
Author

Run correctly a Spring App on JBoss

Antonio Foglia
Greenhorn

Joined: Jun 30, 2013
Posts: 17
I'm new to Spring and i'm developing my first application. I want to run it on JBoss AS 7.1. First of all i've configured jboss to deploy spring application and it works fine.

18:10:50,940 INFO [org.jboss.snowdrop] (ServerService Thread Pool -- 28) Activating Spring Deployer subsystem

So i've created my first simple Spring Maven Project and i've write a simple bean



So i've tried to include the Spring Project into an ear and then deploy it. I got no error but in the console i can't see "HELLO WORLD". I'm sure that i'm missing something to work fine with Spring
Thanks
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2435
    
  28

WHat's your end goal? DO you want to learn how to build a web application with Spring? You might want to go through the SPring tutorial if you haven't already

The reason why you don't see Hello world is this:- For SPring to load your bean and call it, something has to ask Spring to load the application context. Spring won;t do it just because you have it in class path. Someone has to call the correct API that tells Spring to load the XML file. Normally, in an SPring MVC application, you declare a DispatcherServlet in your web.xml. This is a servlet provided by Spring. WHen the DispatcherServlet initializes, it loads the Spring XML file.

Your problem will be fixed by including DIspatcherservlet in web.xml. However, you will be better off going through the SPring tutorial
Antonio Foglia
Greenhorn

Joined: Jun 30, 2013
Posts: 17
Jayesh A Lalwani wrote:WHat's your end goal? DO you want to learn how to build a web application with Spring? You might want to go through the SPring tutorial if you haven't already

The reason why you don't see Hello world is this:- For SPring to load your bean and call it, something has to ask Spring to load the application context. Spring won;t do it just because you have it in class path. Someone has to call the correct API that tells Spring to load the XML file. Normally, in an SPring MVC application, you declare a DispatcherServlet in your web.xml. This is a servlet provided by Spring. WHen the DispatcherServlet initializes, it loads the Spring XML file.

Your problem will be fixed by including DIspatcherservlet in web.xml. However, you will be better off going through the SPring tutorial

thank you for your quick response
I had an EJB application that communicate with an android through MQTT protocol.
I've read about Spring, about IoC and about Spring Integration with MQTT. I foud it real interesting for several reasons(ioc, runnable as beans, integrations etc..)
So my real goal is to develop an application that receives, elaborate and store data received through Mqtt.
I also need a web interface too, like the one I had in the EJB application. I know i have to read a lot but i want to be sure if it is the correct way.
I will try with a web application in a first moment

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Run correctly a Spring App on JBoss