cancel
Showing results for 
Search instead for 
Did you mean: 

java application which starts on application-server start

0 Kudos

hi,

how do i write a simple java project which can deployed on the sap netweaver application which gets started on startup?

i dont want to write a portalcomponent or something like that.. it just should be a sort of programm which simply starts and is deployed inside the applicaiton server.

hope you understand what i want,

thanks in advance,

constantin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Constantin,

Here are three sample applications:

Creating Your First Web Dynpro Application

http://help.sap.com/saphelp_nw04/Helpdata/EN/fd/ed32a8c9994b4ba4a1645a764814db/frameset.htm

Creating Your First J2EE Application

http://help.sap.com/saphelp_nw04/Helpdata/EN/7d/cf0c8abcc34594ba9d3bbd5dd22155/frameset.htm

Creating a J2EE-Based Car Rental Application

http://help.sap.com/saphelp_nw04/Helpdata/EN/70/13353094af154a91cbe982d7dd0118/frameset.htm

Just follow the steps from one of the tutorials and you will develop and deploy your first application.

Regards,

Ventsi Tsachev

Technology Development Support (J2EE Engine)

SAP Labs, Palo Alto, Ca (USA)

Former Member
0 Kudos

Hi,

You can use the listener component of web applications.

In your web.xml, include a listener like

<listener>
        <listener-class>com.xxxx.MyListener</listener-class>
    </listener>

In the zero argument constructor of this MyListener class, call the method which starts your thread/listener. Once you deploy this war/ear to the server, the constructor of the MyListener class will be executed.

Hope this will help.

Thanks,

Venkat

0 Kudos

hi,

thanks for your answer, but thats not what i wanted. i know how to write dynpros, j2ee applications etc.

okay.. let me try to explain it simple.

this is my java-code

public class Server {
	public static void main(String[] args) {
		System.out.println("i started with the sap application server, now i'm waiting to serve...");
		while (true) {
			// NOOP - wait for something
		}
	}
}

i just want that this application runs inside the sap application server... so i can deploy it (using nwdi and cms) and which runs at startup (maybe a deployment-descriptor)

hope you know what i want...

regards

Former Member
0 Kudos

Hi,

I am not sure if what you want could be done. However, in my solution you dont have to necessarily create the JSPs and servlets. You can just use the classes and the web.xml file.

This will help you later in having UI elements to start/stop your thread/listener using JSP.

Thanks,

Venkat

0 Kudos

i dont want to use jsp's or servlets....