• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
faiza haris
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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`
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic