wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes servlet deploymnt on weblogic...u had difficulties too???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "servlet deploymnt on weblogic...u had difficulties too????" Watch "servlet deploymnt on weblogic...u had difficulties too????" New topic
Author

servlet deploymnt on weblogic...u had difficulties too????

faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
i'm sorry for the long subject, but i wonder how to see my servlet deployed on the weblogic server.
The war file shows in the deployment web applications console but the simple http://127.0.0.1:7001/HelloWorldServlet/ when deployed shows error 403.
No ones answered in the weblogic forum, so i'm trying my luck in this forum!!!
Helpp...
faiza
jyothi ve
Ranch Hand

Joined: Aug 03, 2001
Posts: 51
status:403 means server understood the request but refusing to fullfill it. This may be URL Addr problem
I am thinking but not sure since you deployed servlet in web app structure I think you need to append web app name before the servlet url pattern(you define this in web.xml file).
I used weblogic for deploying servlets.
I followed web app directory structure
Here I am pasting web.xml entry see if it can helps to u
*******************************
<servlet>
<servlet-name>ServletEx1Servlet</servlet-name>
<servlet-class>test.ServletEx1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletEx1Servlet</servlet-name>
<url-pattern>/ServletEx1</url-pattern>
</servlet-mapping>
*******************************
the URL used in the browser to access the servlet is
http://localhost:7001/test/ServletEx1
where test is the web application name that you define in weblogic.properties file

[This message has been edited by jyothi ve (edited December 31, 2001).]
[This message has been edited by jyothi ve (edited December 31, 2001).]


Jyothi<br /> <br />Sun Certified Business Component Developer<br />Sun Certified Web Component Developer<br />Sun Certified Java Programmer<br />Oracle Certified SQL & PL-SQL Programmer
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
Thank you for the prompt reply!!
I couldnt figure out the dir structure and the web address co-relation. I will figure this today. No properties file in weblogic 6.0.
Thanx again!
I'll surely tell what my error was!
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
Nahh...still not working
Can u please send me everything, servlet java class, web.xml, and weblogic.xml?
and the dir structure where u'r keeping the files....ahhh its so frustrating and taking so long, i wonder if another day will go waste:/
thanx for the time
faiza
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
Now its a new error
404 Not Found
The server has not found anything matching the Request-URI.
Im now working on wls6.1, and my war file shows in dir ...config/mydomain/applications but doesnt get deployed in the console, i have to specifically install it.
Is this the difference in versions or deployment error?
Plz help as this is getting even more confusing and the here are my files
web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>Examples Web Application</display-name>

<servlet>
<servlet-name>HelloWorldServlet1</servlet-name>
<servlet-class>faiza.servlets.HelloWorldServlet1</servlet-class>
</servlet>



<servlet-mapping>
<servlet-name>HelloWorldServlet1</servlet-name>
<url-pattern>/HelloWorldServlet1/*</url-pattern>
</servlet-mapping>

<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>htm</extension>
<mime-type>text/html</mime-type>
</mime-mapping>

</web-app>
HelloWorldServlet1.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class HelloWorldServlet1 extends HttpServlet {

public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException
{
res.setContentType("text/html");

PrintWriter out = res.getWriter();

out.println("<html><head><title>Hello World!</title></head>");
out.println("<body>");

out.println("<h1>Hello World!</h1></body></html>");

}
}
weblogic.xml
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 6.0//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd">
<weblogic-web-app>
<jsp-descriptor>
<jsp-param>
<param-name>
pageCheckSeconds
</param-name>
<param-value>
1
</param-value>
</jsp-param>
<jsp-param>
<param-name>
verbose
</param-name>
<param-value>
true
</param-value>
</jsp-param>
</jsp-descriptor>
</weblogic-web-app>

Thanx and looking forward to some feedback
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
On Restarting the Server I get an error for the previously created war files
--------------- nested within: ------------------
weblogic.j2ee.DeploymentException: Could not load HelloWorldServlet1 - with nest
ed exception:
[weblogic.j2ee.DeploymentException: Could not load web application from 'C:\bea\
wlserver6.1\.\config\mydomain\applications\.wlnotdelete\wl_comp15564.war']
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:424)
at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
at weblogic.j2ee.Application.addComponent(Application.java:160)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:144)
at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServe
r.java:76)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
Is it better to practice on Tomcat, i mean relatively easier?
thanx
faiza
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
I'm not currently working with WLS, but was during the middle of last year.
I don't have documentation, but seem to recall that 6.1 was broke badly unless you have some service pack level installed. I do not remember the SP number. Do you have any SP's on?
HTH, Guy
jyothi ve
Ranch Hand

Joined: Aug 03, 2001
Posts: 51
Yes. Practicing in Tomcat is very easy. Get Tomcat 4.0 & try servlets.
In both the servers configuration & deployment of servlets is same.
Basically you have to define web app folder.
Keep all your
1. jsp, html, images under that folder.
2. under the web app folder create WEB-INF dir.
/WEB-INF/classes/ - for Java classes
/WEB-INF/lib/ - for application specific jars
/WEB-INF/web.xml - Register servlets
when accessing jsp/servlet/html prepend web app name.
Ex: if your web app name is 'testwebapp' & servlet URL-pattern in web.xml is /HelloWorld

you should access
http://localhost:7001/testwebapp/HelloWorld
- in Weblogic
http://localhost:8080/testwebapp/HelloWorld
- in Tomcat

[This message has been edited by jyothi ve (edited January 01, 2002).]
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
I'M installing tomcat now.
yeah i had sp1 and for wls6.0 sp2
anyway i'm still not clear abt my error. i;ll try tomcat .
Thanx for all the feedback
faiza`
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet deploymnt on weblogic...u had difficulties too????