Good day!
I want to tell you about servlets deployment on Oracle Weblogic server. Its my first post in English, so sorry for my language - its not my native:)
So, we developed some Java servlets and want to deploy them on server for testing it. If you read this article, i can suggest, that you are interesting in Weblogic server. There are several ways to deploy servlets, for example using Weblogic Administration console or using weblogic.Deployer tool. I like command-line tools, because its really simple, fast and give me many ways to automate my work. Weblogic.Deployer - command-line utilite for fast deploying applications on weblogic server.
First, we need create war file (Web Application Archive, see wikipedia) with our servlets. In windows (unix's way is not so different) we need write this code in terminal:
chdir C:\dir\with\servlets\
jar -cvf myServlets.war *
First line changes current directory to directory with our servlets. Second line creates one war file with all files of our servlets - html, css, js, WEB-INF directory with web.xml and so on. So we have myServlets.war file.
Now we can deploy it - with weblogic.Deployer utilite it is really simple:
Yeah! Is it not cool? Some notes. Weblogic must be started for work with weblogic.Deployer - deploying can be done only on the running server, of course. Also console application must be deployed (you can load url http://localhost:7001/console for it, its very simple).
This way of deploying java servlets is more fast than using web interface of administration console.
Now we can deploy it - with weblogic.Deployer utilite it is really simple:
java -cp C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar weblogic.Deployer -adminurl t3://localhost:7001 -user myusername -password mycoolpass -deploy myServlets.war
Yeah! Is it not cool? Some notes. Weblogic must be started for work with weblogic.Deployer - deploying can be done only on the running server, of course. Also console application must be deployed (you can load url http://localhost:7001/console for it, its very simple).
C:\Oracle\Middleware\wlserver_10.3\
is directory with installed Weblogic server. localhost:7001
is URL of my Weblogic Administrtion console (note that I use t3 instead of http protocol), myusername
is username for administration console and mycoolpass
is password for this account. So, we need just 2 commands for create war file and deploy it on server! 2 commands is too much? Ok, we can merge it:jar -cvf myServlets.war * && java -cp C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar weblogic.Deployer -adminurl t3://localhost:7001 -user myusername -password mycoolpass -deploy myServlets.war
This way of deploying java servlets is more fast than using web interface of administration console.
Комментариев нет:
Отправить комментарий