Web Application directory structure
Please can someone help me with directing me to any online guide as to how webapp could be created and web.xml configuration in Sun Application server 8.
I do not understand the directory structure of sun, unlike Tomcat the webapps contains all the virtual context part with a default ROOT direct set in the server.xml as the default docbase.
Now, where is the default ROOT in Sun server? Where can I put my index file. When I create a web context, where will I put it? Does J2EE has similar WEB-INF structure in Tomcat? Does it have web.xml to configure the webapp
Finally, I have written a simple EJB called Hello World using stateless protocol. I have my Hello.class, HelloHome.class and HelloBean.class. I also have ejb-jar.xml for container configuration. I have jar then up to hello.jar and have deployed them. Now I want to access the beans, Home bean to be precises. I have written a hello.jsp and I put it in the orignal directory where the main index.html file is in Sun server which is /user/Sun/AppServer/domains/domain1/docroot, I got errors.
Could someone shade a light on this please.
Thanks Guys.
NB
Do not point me to online reference
I have awared max point for this question
The developer's guide discusses in pretty clear terms how to deploy a J2EE app from a directory structure.
The tomcat directory structure is really the same as a packaged war which once you read the documentation you will see is basically no different with SJSAS.
You need to deploy an application. See previous posts on how to have docroot be the top level (search for posts by janluehe)
Similar Messages
-
Where should one register a web application directory
Hi:
I have created a server domain and server instance for weblogic 8.1. Could someone
please tell me where I should register the web application directory so that my
jsp files could be served from this directory or a sub-directory of this web application
directory?
Thanks in advance.
RinoYes, it did work!
Thanks a lot.
Rino
"Deepak Vohra" <[email protected]> wrote:
>
Rino,
Is directory structure of the WebApplication the following?
user_projects/mydomain/applications/myWebApp/jsp/HelloWorld.jsp
myWebApp/WEB-INF/web.xml
myWebApp/WEB-INF/weblogic.xml
thanks,
Deepak
"Rino" <[email protected]> wrote:
I did put the web application directory "myWebApp" under the "applications"
folder
but it still gives me error 404-Not Found.
The content my my weblogic.xml file is as follows:
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
Systems, Inc.//DTD Web Application 8.1//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<context-root>myWebApp</context-root>
</weblogic-web-app>
Can someone explain me how the applications folder serves the jsp pages?
And
also what I may be doing wrong
Thanks.
Rino
"Deepak Vohra" <[email protected]> wrote:
I created a web application directory "myWebApp" under my weblogichome directory.
The web application directory "myWebApp" should be under the 'applications'
directory.
thanks,
Deepak
"Rino" <[email protected]> wrote:
Thanks for your response. However, I still could not get it to work.
My weblogic home is "C:\bea\weblogic81"
I created a web application directory "myWebApp" under my weblogic
home
directory.
I also created a WEB-INF folder under "myWebApp" directory.
After this I created "weblogic.xml" file under the WEB-INF folder.
The content of my weblogic.xml file is as follows:
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
Systems, Inc.//DTD Web Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<context-root>myWebApp</context-root>
</weblogic-web-app>
Under my web application folder i.e. "myWebApp" I have a sub-directory
named jsp.
In this sub-directory I placed my helloworld.jsp file.
Now when I try to run my jsp file from the browser as follows.
http://localhost:port/jsp/helloworld.jsp
I get an error message "Error 404-Not Found
Could someone let me know what I am doing wrong here?
Thanks in advance.
Rino
"Deepak Vohra" <[email protected]> wrote:
The applications directory has a default Web Applications directory,
DefaultWebApp.
To specify a Web Applications dir other than the DefaultWebApp dir,specify
the
web app dir in
the context-root element of weblogic.xml deployment descriptor.
thanks,
Deepak
"Rino" <[email protected]> wrote:
Hi:
I have created a server domain and server instance for weblogic
8.1.
Could someone
please tell me where I should register the web application directory
so that my
jsp files could be served from this directory or a sub-directoryof
this
web application
directory?
Thanks in advance.
Rino -
Nested web applications directory.
I recently design the jsp development structure in my company.
It is basically contain two webapps which is productionLine webapp and developmentLine webapp.
In my developmentLine webapp contain several programmers. Each of them has their own user directory in developmentLine webapp but i face a trouble which is each subdirectory cannot run their servlet in WEB-INF.
In http://localhost/developmentLine/servlet/servletname is running fine but once i move the webapp into user directory then it cause the problem like http://localhost/development/John/servlet/servletname. It is not working. Any idea about it?
design jsp development structure based.
root
-> productionLine
\t -> HR
\t -> Admin
-> developmentLine
-> John
-> HR
-> webster
-> Admin
Is the tomcat support nested webapplication? else i think i need put entire servlet in the common library to shared among each web applications.
Edited by: webster on Nov 15, 2008 12:30 PMBecause my company didn't install the any Java Tools before. I need to install entire java development Tools and assigned each particular directories in Tomcat web server for each developer. what's mean of "hacked"?
I intent to put assigned each developer a userId directory in developmentLine directory. what i trying to do is allow each userId subdirectory in web application directory (i.e. ROOT, webdav, balancer and etc) to have their own servlet classes in WEB-INF directory.
cause my company required put all the source code into a single server. Their think it is much more easier to maintain.
so I am trying to install two tomcat in a server. I had change my http port, shutdown port and AJP port to 80, 89 and 85. When i try install a new Tomcat with same version into server, it pop up an error msg.
Failed to install Tomcat5 service.
Check your settings and permissions
Ignore and continue anyway (not recommended)
I choose ignore it, and continue install. Afterward my web application in port 80 change to 8080. I think it is replace the old tomcat server instead of running both tomcat together.
Any idea?
p/s: previous tomcat installation path is C:\Program Files\Apache Software Foundation\Tomcat 5.5 and another tomcat server installation path is C:\Program Files\Apache Software Foundation\Tomcat 5.52.
Edited by: webster on Nov 17, 2008 10:39 AM -
Where to keep new OA page(RN.XML in oracle Application Directory structure?
I have created a new XML region which I want to use in page through Personalization.
where should I copy this file into Application Directory structure?
I am using this command to import -
import C:\OA\jdevhome\jdev\myprojects\xbol\oracle\apps\ota\admin\enrollment\webui -jdk13 -mmddir "C:\OA\jdevhome\jdev\myhtml\OA_HTML\jrad" -rootdir C:\OA\jdevhome\jdev\myprojects -validate -username apps -password apps -dbconnection "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = xxxas.com)(Port = 0000)))(CONNECT_DATA = (SID = xxx)(SERVER = DEDICATED)))"I imported the XML file but when I am trying to refer the xml file through personalization by giving path
'xbol\oracle\apps\ota\admin\enrollment\webui\XbolLearnerSearchRN'
It is erroring out saying
'Extends: Invalid value: xbol\oracle\apps\ota\admin\enrollment\webui\XbolLearnerSearchRN: the reference may not exist. (oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = xbol\oracle\apps\ota\admin\enrollment\webui\XbolLearnerSearchRN, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository.)'
My requirment is - I want to use this xml file in FlexLayout for the personalization.
Please Guide me, where I am missing. -
Is there some standard directory structure when building J2EE web application that consists for example JSP pages, servlets, EJB components, pictures etc.
place all your jsps in "jsp" folder under the project folder.
Create a folder called "WEB-INF" under the project folder which contains all your servlets, and web.xml and taglib.tld files. Your servlets that is .class files should be in a folder "classes" under "WEB-INF".
The .html files and picture files are under the project folder.
I hope it will help you some how.
But, the directory structure depends upon the Framework you are using such as Struts, Spring or Axis. -
Creating a folder in web application directory?
Hi
I have a web application which contains some jsps and servlets and i am running it on Apache Tomcat 4.1. The name of my application is MyApp which contains all the servlets and jsps.
In order to deploy the application i have placed the MyApp folder in the 'webapps' folder of Tomcat. Now in one of my servlets i.e. 'DirectoryCreator', i am trying to create a folder i.e. 'Directory' in the MyApp folder. The problem is that i dont want to give an absolute path to the File class constructor. The class files of my servlets are in classes folder i.e. MyApp \ Web-INF \ classes.
I have tried:
File f = new File("/Directory");
f.mkdir();
but this creates the Directory folder in my C drive.
Please tell me how i can avoid giving the absolute path.
Thanks.if the code to create the directory is a servlet, you can use
String path=getServletContext().getRealPath("/");
//getRealPath("/") will return the actual path on your machine of the base directory
//of the webapp. getRealPath("/SomeDirectory/SomeFile") will return the real
//path of SomeFile
File f=new File(path + "/Directory");
if(!f.exists())
f.mkdir();if the code is in a .jsp file simple replace getServletContext(). with application. -
Application directory structure
Hi,
I would like to develop a B2C application on portal 8.1
What is the recommended directory structure to store portlets, html, images,servlets
and beans? Where can I find the information?
Thanx
MeeGenerally, you put the files you have in app under webapps/ROOT in the server directory, or figure out what the right mapping is in the server.xml file to define your directory as root. I forget how.
-
How can WLS use JSP pages in a Web Application (either a .war file or a war directory structure) without a java compiler?
I suspect either the JSP specification is flawed (i.e. it doesn't take account of servers using just a JRE), or BEA's implementation is broken.
Production servers do not have a JDK installed. They only have a JRE. Therfore a java compiler is not present on the machine that the Web Application is deployed onto.
On the development machine, when the server is requested to load the JSP it creates a tmpwar directory within the Web Application directory structure. This is then included in the resultant .war file thus:
D:\war>jar -tf gmi.war
META-INF/
META-INF/MANIFEST.MF
gmiService.jsp
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/bt/
WEB-INF/classes/com/bt/gmi/
WEB-INF/classes/com/bt/gmi/gmiService.class
WEB-INF/getList.xsl
WEB-INF/getListByConnection.xsl
WEB-INF/getListByDistrict.xsl
WEB-INF/getListByDistrictConnection.xsl
WEB-INF/lib/
WEB-INF/source/
WEB-INF/source/build.bat
WEB-INF/source/gmiService.java
WEB-INF/web.xml
WEB-INF/weblogic.xml
tmpwar/
tmpwar/jsp_servlet/
tmpwar/jsp_servlet/_gmiservice.class
tmpwar/jsp_servlet/_gmiservice.java
When deployed on the production server with the web.xml file set to use the following values (note XML stripped):
weblogic.jsp.pageCheckSeconds
-1
weblogic.jsp.precompile
false
weblogic.jsp.compileCommand
javac
weblogic.jsp.verbose
true
weblogic.jsp.packagePrefix
jsp_servlet
weblogic.jsp.keepgenerated
false
And in the weblogic.properties file:
weblogic.httpd.webApp.gmi=war/gmi
I've also tried with the .war file, but that insists on creating another tmpwar directory outside of the .war file.
Then, although I have set pageCheckSeconds to -1 (don't check and don't recompile) ter production server still attempts to recompile the JSP's:
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: init
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param verbose initialized to: true
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param packagePrefix initialized to: jsp_servlet
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param compileCommand initialized to: javac
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param srcCompiler initialized to weblogic.jspc
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param superclass initialized to null
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param workingDir initialized to: /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param pageCheckSeconds initialized to: -1
Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: initialization complete
Mon Sep 25 11:40:12 BST 2000:<I> <WebAppServletContext-gmi> Generated java file: /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java
Mon Sep 25 11:40:14 BST 2000:<E> <WebAppServletContext-gmi> Compilation of /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java failed: Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[javac, -classpath, /opt/Solaris_JRE_1.2.1_04/lib/rt.jar:/opt/Solaris_JRE_1.2.1_04/lib/i18n.jar:/opt/Solaris_JRE_1.2.1_04/classes:/var/wls/5.1/weblogic/lib/weblogic510sp4boot.jar:/var/wls/5.1/weblogic/classes/boot:/var/wls/5.1/weblogic/eval/cloudscape/lib/cloudscape.jar:/var/wls/5.1/weblogic/lib/wleorb.jar:/var/wls/5.1/weblogic/lib/wlepool.jar:/var/wls/5.1/weblogic/lib/weblogic510sp4.jar:/var/wls/5.1/weblogic/license:/var/wls/5.1/weblogic/classes:/var/wls/5.1/weblogic/lib/weblogicaux.jar:/opt/wls-servers/gmiServer/weblogic/gmiServer/serverclasses:/opt/wls-servers/gmiServer/weblogic/lotusxsl.jar:/opt/wls-servers/gmiServer/weblogic/xerces.jar:/opt/wls-servers/gmiServer/weblogic/logging.jar::/opt/wls-servers/gmiServer/weblogic/war/gmi/WEB-INF/classes:/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war, -d, /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war, /opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.java])
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Compiled Code)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:200)
at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:187)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:142)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
at weblogic.kernel.ExecuteThread.run(Compiled Code)
The default Java compiler from sun lives in the tools.jar that comes with
the JDK. Just add that to your set of JARs which are deployed in production
and you should be fine. No need to install the full JDK - just make the
tools.jar available to WebLogic.
Regards
James
James Strachan
=============
email: [email protected]
web: http://www.metastuff.com
"Martin Webb" <[email protected]> wrote in message
news:[email protected]...
>
> How can WLS use JSP pages in a Web Application (either a .war file or a
war directory structure) without a java compiler?
>
> I suspect either the JSP specification is flawed (i.e. it doesn't take
account of servers using just a JRE), or BEA's implementation is broken.
>
> Production servers do not have a JDK installed. They only have a JRE.
Therfore a java compiler is not present on the machine that the Web
Application is deployed onto.
>
> On the development machine, when the server is requested to load the JSP
it creates a tmpwar directory within the Web Application directory
structure. This is then included in the resultant .war file thus:
>
> D:\war>jar -tf gmi.war
> META-INF/
> META-INF/MANIFEST.MF
> gmiService.jsp
> WEB-INF/
> WEB-INF/classes/
> WEB-INF/classes/com/
> WEB-INF/classes/com/bt/
> WEB-INF/classes/com/bt/gmi/
> WEB-INF/classes/com/bt/gmi/gmiService.class
> WEB-INF/getList.xsl
> WEB-INF/getListByConnection.xsl
> WEB-INF/getListByDistrict.xsl
> WEB-INF/getListByDistrictConnection.xsl
> WEB-INF/lib/
> WEB-INF/source/
> WEB-INF/source/build.bat
> WEB-INF/source/gmiService.java
> WEB-INF/web.xml
> WEB-INF/weblogic.xml
> tmpwar/
> tmpwar/jsp_servlet/
> tmpwar/jsp_servlet/_gmiservice.class
> tmpwar/jsp_servlet/_gmiservice.java
>
> When deployed on the production server with the web.xml file set to use
the following values (note XML stripped):
>
> weblogic.jsp.pageCheckSeconds
> -1
>
> weblogic.jsp.precompile
> false
>
> weblogic.jsp.compileCommand
> javac
>
> weblogic.jsp.verbose
> true
>
> weblogic.jsp.packagePrefix
> jsp_servlet
>
> weblogic.jsp.keepgenerated
> false
>
>
> And in the weblogic.properties file:
>
> weblogic.httpd.webApp.gmi=war/gmi
>
> I've also tried with the .war file, but that insists on creating another
tmpwar directory outside of the .war file.
>
>
> Then, although I have set pageCheckSeconds to -1 (don't check and don't
recompile) ter production server still attempts to recompile the JSP's:
>
>
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: init
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
verbose initialized to: true
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
packagePrefix initialized to: jsp_servlet
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
compileCommand initialized to: javac
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
srcCompiler initialized to weblogic.jspc
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
superclass initialized to null
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
workingDir initialized to:
/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp: param
pageCheckSeconds initialized to: -1
> Mon Sep 25 11:40:11 BST 2000:<I> <WebAppServletContext-gmi> *.jsp:
initialization complete
> Mon Sep 25 11:40:12 BST 2000:<I> <WebAppServletContext-gmi> Generated java
file:
/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
java
> Mon Sep 25 11:40:14 BST 2000:<E> <WebAppServletContext-gmi> Compilation of
/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
java failed: Exception in thread "main" java.lang.NoClassDefFoundError:
sun/tools/javac/Main
>
> java.io.IOException: Compiler failed
executable.exec([Ljava.lang.String;[javac, -classpath,
/opt/Solaris_JRE_1.2.1_04/lib/rt.jar:/opt/Solaris_JRE_1.2.1_04/lib/i18n.jar:
/opt/Solaris_JRE_1.2.1_04/classes:/var/wls/5.1/weblogic/lib/weblogic510sp4bo
ot.jar:/var/wls/5.1/weblogic/classes/boot:/var/wls/5.1/weblogic/eval/cloudsc
ape/lib/cloudscape.jar:/var/wls/5.1/weblogic/lib/wleorb.jar:/var/wls/5.1/web
logic/lib/wlepool.jar:/var/wls/5.1/weblogic/lib/weblogic510sp4.jar:/var/wls/
5.1/weblogic/license:/var/wls/5.1/weblogic/classes:/var/wls/5.1/weblogic/lib
/weblogicaux.jar:/opt/wls-servers/gmiServer/weblogic/gmiServer/serverclasses
:/opt/wls-servers/gmiServer/weblogic/lotusxsl.jar:/opt/wls-servers/gmiServer
/weblogic/xerces.jar:/opt/wls-servers/gmiServer/weblogic/logging.jar::/opt/w
ls-servers/gmiServer/weblogic/war/gmi/WEB-INF/classes:/opt/wls-servers/gmiSe
rver/weblogic/war/gmi/_tmp_war, -d,
/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war,
/opt/wls-servers/gmiServer/weblogic/war/gmi/_tmp_war/jsp_servlet/gmiService.
java])
> at java.lang.Throwable.fillInStackTrace(Native Method)
> at java.lang.Throwable.fillInStackTrace(Compiled Code)
> at java.lang.Throwable.<init>(Compiled Code)
> at java.lang.Exception.<init>(Compiled Code)
> at java.io.IOException.<init>(Compiled Code)
> at
weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Compiled Code)
> at
weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:200)
> at weblogic.servlet.jsp.JspStub.compilePage(Compiled Code)
> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
> at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:18
7)
> at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:118)
> at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:142)
> at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:744)
> at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:692)
> at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:251)
> at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
> at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
> at weblogic.kernel.ExecuteThread.run(Compiled Code)
>
>
>
-
Directory Structure for multiple applications at one host
Can I have multiple (more than one) WEB-INF directory structures in the public_html directory for different web applications? If I do this, how do setup the url-pattern in the Servlet Mapping tag in the web.xml file? How do I setup the URL that calls the servlet from the HTML that has been send to the user�s browser?
If I understand your question, you want multiple contexts. All App Servers/Web Servers allow you to setup multiple contexts. Normally if your root context is in /home/myhome/app_server/
then you would setup multiple contexts by creating a folder for each context:
/home/myhome/app_server/context1/
/home/myhome/app_server/context2/
Each would have their own full application/website. And the way to reference these would be as such:
if the domain, www.mydomain.com, is mapped to /home/myhome/app_server/
www.mydomain.com/context1/
www.mydomain.com/context2/
I think that is what you were asking. Hope it helps -
Deploy web application with exploded directory format
I am quite new with Oracle9iAS Containers for J2EE. Currently, my project is not using EJB, only JSP and Servlets. I want to deploy the war file with exploded directory format. I don't want to use the default web application directory j2ee/home/default-web-app. The "Using Oracle9iAS Containers for J2EE" get start documentation only explained how to deploy J2ee application. What about the web application without EJB jar file? Anybody knows how to do that. Please let me know.
Thanks in advance.Though you don't have ejbs, you can still use the ear file format. This would be most convenient way of deploying.
Use of a tool like Ant is recommended if you are not using JDeveloper.
Also, you can findinfo on deploying using a exploded directory
http://otn.oracle.com/docs/tech/java/oc4j/htdocs/getstart.htm#1027810
But recommed having ear file as it is convenient. If you want to see an example of use of Ant and deploying using ear file
check out one of the recently posted how-tos E.g. http://otn.oracle.com/tech/java/oc4j/htdocs/how-to-servlet-events.html -
Serializing a JavaBean to the WEB-INF directory or subdirectories
Hello, I'm hoping someone can help me on this.
I'm working with two scenarios in WSAD Enterprise Edition 5.0.0.2 for
serializing a JavaBean (called AddressBean) to the following location
in my Web application:
/WEB-INF/classes/resources/serializable
The data corresponding to the bean I'm serializing is being stored in
a file with a name that makes it unique on the file system (e.g.
jeff.ser, jill.ser). In the first scenario, I start by getting a
FileOutputStream, then an ObjectOutputStream which is then used to
write my JavaBean as needed. All of this is done in the first
scenario from a JSP located in:
myWebApp/Web Content/jsp/JSP1.jsp
That works fine and as I'd expect. However, I'm not able to do that
in the second scenario. In this scenario, I created an additional
method in the bean itself that will actually serialize an object of
its own type to the same directory structure that I showed above (i.e.
under the WEB-INF directory). That is, in my bean, I have the
following:
public void writeDataToFile(AddressBean bean, String path) {
FileOutputStream fos = null;
ObjectOutputStream oos = null;
try {
fos = new FileOutputStream(path);
oos = new ObjectOutputStream(fos);
oos.writeObject(bean);
oos.close();
catch(Exception e) {
e.printStackTrace();
In this scenario, another JSP (call it JSP2.jsp) is creating an
instance of AddressBean by using the jsp:useBean tag. The real path
for the .ser file is figured out in the JSP code (same as was done in
JSP1.jsp), and then I delegate the serialization part to the bean
itself like so:
// In JSP2.jsp
<jsp:useBean id="ab" class="examples.beans.simple.AddressBean" />
AddressBean address = (AddressBean) pageContext.getAttribute("ab");
// get the path
String path = ...
String realPath = application.getRealPath(path);
// write the object
address.writeDataToFile(ab, realPath);
What happens is that I get a FileNotFoundException while trying to
create the FileOutputStream in the writeDataToFile() method in
AddressBean at runtime. The message in the console states:
java.io.FileNotFoundException:
C:\WINNT\Profiles\myself\Personal\IBM\wsad\myworkbench\myWebApp\Web
Content\ (Access is denied)
The source file for AddressBean is located at:
myWebApp/Java Source/examples.beans.simple.AddressBean
WHAT is going on here!? I know that everything stored underneath the
WEB-INF directory is not served to clients so I'm also assuming that
whatever stored in that directory or its subdirectories is not
accessible to clients by default. The only real difference between
the two scenarios that I've described is that in the second one, the
attempt to get a FileOutputStream is being made by a resource (i.e.
AddressBean) that is outside of the "Web Content" directory structure
in WSAD. However, the "Java Source" directory, which contains the
package housing my AddressBean class, is also under myWebApp so I'm
not seeing what the problem is at the moment.
If anyone has any ideas, suggestions, solutions, please let me know.
I'm stumped. Thank you!
JeffI figured it out, and it was my mistake. The problem was in a method defined in my AddressBean class that would take a String argument and use it to help create a unique file name (i.e. one with a .ser extension to contain the serialized bean data) for purposes of serialization later.
Basically, I was using a local variable in the method unintentionally instead of the instance variable that I had defined in the bean so my path value was null at runtime--hence the FileNotFoundException.
I'm still not sure why the (Access is denied) message was appearing, but I suspect it was b/c the absolute path that I'd end up with at runtime wasn't kosher; or, not having a destination .ser file was the problem.
In any event, I fixed the mistake and could serialize a JavaBean in several ways:
1. From a JSP directly
2. By using a method defined in the JavaBean itself
3. By passing on the request, which contained the JavaBean as an attribute, to a servlet that took care of the serialization
Jeff -
Using: WebLogic 6.1 SP3 (J2EE 1.3)
I have an application which consists of an EJB JAR file and a WAR file which I used to deploy to JBoss and Tomcat respectively. They are working fine in that environment. I want to deploy this application to WebLogic 6.1 SP3.
1. I generated another JAR file which can be deployed to WebLogic using ejbc (after adding weblogic-ejb-jar.xml file). It went fine and I moved this JAR to weblogic/config/examples/applications folder. I saw in the log file that the EJB's in that JAR file were successfully deployed.
2. The problem happened when I moved the WAR file to weblogic/config/examples/applications folder. It tried to deploy the web application, but threw an error. These are the messages from the log.
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101053> <[HTTP examplesServer] Loading web app: cronus>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101060> <[examplesServer] Loading "cronus" from directory: "d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus">
<Warning> <J2EE> <europa> <examplesServer> <main> <system> <> <160007> <You are running WebLogic Server with J2EE 1.3 features enabled. The implementation of specific J2EE 1.3 features (EJB 2.0, JSP 1.2, Servlet 2.3, and J2EE Connector Architecture 1.0) in BEA WebLogic Server 6.1 is of a non-final version of the appropriate specification. It is subject to change in future releases once the specification becomes finalized. This may cause application code developed for BEA WebLogic Server 6.1 that uses the new features of J2EE 1.3 to be incompatible with the J2EE 1.3 platform supported in future releases of BEA WebLogic Server.>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101031> <[WebAppServletContext(4192856,cronus,/cronus)] extracting classfiles to d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus\WEB-INF\_tmp_war_cronus:>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101032> <[WebAppServletContext(4192856,cronus,/cronus)] extracted classfiles successfully...>
<Info> <HTTP Session> <europa> <examplesServer> <main> <system> <> <100037> <Creating SessionContext of type: memory for webapp: /cronus>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering classpath servlet with initArgs 'null'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering getior servlet with initArgs 'null'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering tunneling servlets with initArgs 'wl-dispatch-policy=direct'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering JSPServlet with initArgs '[JspConfig: verbose=true,packagePrefix=jsp_servlet,-compiler=d:\bea\weblogic61\jdk131/bin/javac,compileFlags=,workingDir=d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus\WEB-INF\_tmp_war_cronus,pageCheckSeconds=1,superclass=weblogic.servlet.jsp.JspBase,keepgenerated=false,precompileContinue=false,compilerSupportsEncoding=true,encoding=null,defaultfilename=index.jsp,compilerclass=null,noTryBlocks=false]'>
<Error> <Management> <europa> <examplesServer> <main> <system> <> <141042> <Error deploying application d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus: java.lang.reflect.UndeclaredThrowableException>
My web app directory structure is like this
cronus -----------------------> JSP files
WEB-INF ---------------> web.xml
lib ----------------------> all the JAR files (including EJB JAR and JSTL implementation and other reusable JARs)
classes --------------> all the servlet/web app classes
tlds --------------------> TLD files
Any suggestions on how can I fix this?
I appreciate your help.
Thanks.
Velmurugan.
[att1.html]I tried to deploy the web application in exploded format. But I got the same error.
"Vel Periasamy" <[email protected]> wrote in message news:[email protected]...
Using: WebLogic 6.1 SP3 (J2EE 1.3)
I have an application which consists of an EJB JAR file and a WAR file which I used to deploy to JBoss and Tomcat respectively. They are working fine in that environment. I want to deploy this application to WebLogic 6.1 SP3.
1. I generated another JAR file which can be deployed to WebLogic using ejbc (after adding weblogic-ejb-jar.xml file). It went fine and I moved this JAR to weblogic/config/examples/applications folder. I saw in the log file that the EJB's in that JAR file were successfully deployed.
2. The problem happened when I moved the WAR file to weblogic/config/examples/applications folder. It tried to deploy the web application, but threw an error. These are the messages from the log.
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101053> <[HTTP examplesServer] Loading web app: cronus>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101060> <[examplesServer] Loading "cronus" from directory: "d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus">
<Warning> <J2EE> <europa> <examplesServer> <main> <system> <> <160007> <You are running WebLogic Server with J2EE 1.3 features enabled. The implementation of specific J2EE 1.3 features (EJB 2.0, JSP 1.2, Servlet 2.3, and J2EE Connector Architecture 1.0) in BEA WebLogic Server 6.1 is of a non-final version of the appropriate specification. It is subject to change in future releases once the specification becomes finalized. This may cause application code developed for BEA WebLogic Server 6.1 that uses the new features of J2EE 1.3 to be incompatible with the J2EE 1.3 platform supported in future releases of BEA WebLogic Server.>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101031> <[WebAppServletContext(4192856,cronus,/cronus)] extracting classfiles to d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus\WEB-INF\_tmp_war_cronus:>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101032> <[WebAppServletContext(4192856,cronus,/cronus)] extracted classfiles successfully...>
<Info> <HTTP Session> <europa> <examplesServer> <main> <system> <> <100037> <Creating SessionContext of type: memory for webapp: /cronus>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering classpath servlet with initArgs 'null'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering getior servlet with initArgs 'null'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering tunneling servlets with initArgs 'wl-dispatch-policy=direct'>
<Info> <HTTP> <europa> <examplesServer> <main> <system> <> <101047> <[WebAppServletContext(4192856,cronus,/cronus)] registering JSPServlet with initArgs '[JspConfig: verbose=true,packagePrefix=jsp_servlet,-compiler=d:\bea\weblogic61\jdk131/bin/javac,compileFlags=,workingDir=d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus\WEB-INF\_tmp_war_cronus,pageCheckSeconds=1,superclass=weblogic.servlet.jsp.JspBase,keepgenerated=false,precompileContinue=false,compilerSupportsEncoding=true,encoding=null,defaultfilename=index.jsp,compilerclass=null,noTryBlocks=false]'>
<Error> <Management> <europa> <examplesServer> <main> <system> <> <141042> <Error deploying application d:\bea\weblogic61\wlserver6.1\config\examples\applications\cronus: java.lang.reflect.UndeclaredThrowableException>
My web app directory structure is like this
cronus -----------------------> JSP files
WEB-INF ---------------> web.xml
lib ----------------------> all the JAR files (including EJB JAR and JSTL implementation and other reusable JARs)
classes --------------> all the servlet/web app classes
tlds --------------------> TLD files
Any suggestions on how can I fix this?
I appreciate your help.
Thanks.
Velmurugan.
[att1.html] -
IPhone Official Web App Directory?
Has anyone heard about this? Any word on which apps will be included?
Apple to launch official iPhone Web applications directory
http://www.appleinsider.com/articles/07/10/10/appleto_launch_official_iphone_web_applicationsdirectory.htmlI still think appleopolis.com has a better set up, when I can put my favorites on a screen to select from. But its another positive step for Apple and the iPhone, Keep it up guys...your getting there!!!
-
Classpath for web-application.
I am working on a web application with a bunch of jsp files using some
java classes. I am using tomcat 5.5. I have a special class file, say
a.class, sit in the web-inf/classes. This class import another two
jars, say b.jar and c.jar. The jsp file will import a and does not
use b and c. How should I organize them for a war file in server?
I actually write a.java with the jsp file in a web project in netbean
5.5. And the created war file put b.jar and c.jar in web-inf/lib. But
when I deploy the war file, I keep get the
"java.lang.NoClassDefFoundError: org/kowari/itql/ItqlInterpreterBean"
(this is a class in b.jar). I test compiling all the jsp in compile
and it works. I suppose you can specify these classpath related
information somewhere in web-application directory. How to put
everything? Thank you.This is the result of "jar tf display.war". The one I am talking about is KowariStore.class. It use WEB-INF/lib/tupelo2.jar, which use WEB-INF/lib/kowari-1.2.0.jar. The problem is
java.lang.NoClassDefFoundError: org/kowari/itql/ItqlInterpreterBean, this is a package in "kowari-1.2.0.jar".
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/edu/
WEB-INF/classes/edu/uiuc/
WEB-INF/classes/edu/uiuc/lis/
WEB-INF/classes/edu/uiuc/lis/brain/
WEB-INF/lib/
images/
META-INF/context.xml
WEB-INF/bottom.jspf
WEB-INF/classes/edu/uiuc/lis/brain/BrainDB$Database.class
WEB-INF/classes/edu/uiuc/lis/brain/BrainDB.class
WEB-INF/classes/edu/uiuc/lis/brain/KowariStore.class
WEB-INF/classes/edu/uiuc/lis/brain/uiucdoc$Columns.class
WEB-INF/classes/edu/uiuc/lis/brain/uiucdoc$Database.class
WEB-INF/classes/edu/uiuc/lis/brain/uiucdoc.class
WEB-INF/lib/kowari-1.2.0.jar
WEB-INF/lib/mysql-connector-java-3.1.13-bin.jar
WEB-INF/lib/tupelo2.jar
WEB-INF/sun-web.xml
WEB-INF/top.jspf
WEB-INF/web.xml
images/Thumbs.db
images/bg.jpg
images/brain.gif
images/brain_banner.gif
images/ui.gif
index.jsp
relevance.jsp
result.jsp -
Directory Structure ?s for an Exploded Web Application
We have an application that consists only of JSPs and Servlets, no
EJBs. I am researching whether or not it's worthwhile to start using
EJBs. We're also migrating from Weblogic 5 to 6.1. I've managed to
migrate our application fine and have it up and running on WLS 6.1.
I'm confused about the exploded directory structure, the
application.xml file, where to put the EJBs and whether or not I have
to jar them. Here's our current directory structure:
DefaultWebApp/ JSPs here
DefaultWebApp/WEB-INF web.xml and weblogic.xml here
DefaultWebApp/WEB-INF/classes Servlets and other classes here
DefaultWebApp/WEB-INF/lib do my un-jar-ed EJBs go here?
I've been reading a lot of BEA's documentation, particularly
‘Deploying an Exploded J2EE Application' and a ‘Web Application PDF',
and looking for relevant threads on the weblogic.developer.interest
groups. It looks like the application.xml should go in a new
DefaultWebApp/META-INF directory. But where do the EJBs go?
I also see some directory structures with another /web directory
that's confusing me.
Oh, I've also managed to compile and jar up a trial Stateless Session
EJB. Then I think I ‘auto-deployed' it into the /applications
directory, and Weblogic seems to recognize it. But when I tried to
reference it in a JSP, I got an error message ‘class x is public,
should be declared in a file named x.java'. I'm assuming this is
related to the application.xml, where I need to define the ejb
directory.
Thanks.To deploy your web app together with your EJBs, you need to create
an "EAR" structure. Both your webapp and your EJB jars will be within
this new structure, at the same level. You may jar up your EJBs, or you
may explode their structure, it's up to you.
The resulting structure should look something like below:
EnterpriseApp/ <-- new top level
EnterpriseApp/META-INF/
EnterpriseApp/META-INF/application.xml
EnterpriseApp/lib/ <-- shared libraries (if any)
EnterpriseApp/EJB/ <-- ejbs go here
EnterpriseApp/EJB/META-INF/ejb-jar.xml
EnterpriseApp/EJB/META-INF/weblogic-ejb-jar.xml
EnterpriseApp/EJB/com/your/ejb/classes/here
EnterpriseApp/WebApp/ <-- move your current app here
EnterpriseApp/WebApp/index.jsp <-- JSPs goes here
EnterpriseApp/WebApp/other.jsp
EnterpriseApp/WebApp/WEB-INF/web.xml
EnterpriseApp/WebApp/WEB-INF/weblogic.xml
EnterpriseApp/WebApp/WEB-INF/lib <-- ui libraries go here
EnterpriseApp/WebApp/WEB-INF/classes <-- servlets go here
The above structure is identical to the structure to an EAR file, only "exploded"
as actual files and directories instead of being "jarred" into a single EAR file.
Your application.xml in this case would specify something like:
<application>
<display-name>EnterpriseApp</display-name>
<description>My Enterprise Application</display-name>
<module>
<ejb>EJB</ejb>
</module>
<module>
<web>
<web-uri>WebApp</web-uri>
<context-root>/yourAppRoot</context-root>
</web>
</module>
</application>
And in config.xml you would have an entry similar to:
<Application Deployed="true" Name="EnterpriseApp"
Path=".\config\mydomain\applications\EnterpriseApp">
<WebAppComponent Name="ui" Targets="myserver" URI="WebApp"/>
<EJBComponent Name="ejb" Targets="myserver" URI="EJB"/>
</Application>
regards,
-Ade
Maybe you are looking for
-
PDFs appear with fragmented images, metadata missing
Can anyone help with this one? We use InDesign CS3 to create PDF 1.6's, directly from InDesign export. The metadata contained in the images on the layout normally are visible when you control click and select "show metadata" on the image in the resul
-
HTTPS with Client Authentication not available in EHP1?
Hi Guys, I am not seeing this option in PI 7.1 EHP1. At SOAP Adapter (Sender Communication Channel) under "HTTP Security Level"you are able to configure "HTTPS with Client Authentication". any help would be appreciated Thanks, Srini
-
My Iphone 5s shows "No Service" in the specific network area, but if the same sim card is used with other mobiles in the same network area, it shows good network.. i did restore,change sim card, reset all the settings but still not working... please
-
WMI CIM Studio dows not connect to any computer using IE 11
Using a new download and install of WMI CIM Studio and IE 11, I cannot connect to any computer on my network. On opening in IE I get the following warning : Internet explorer restricted this webpage from running scripts or ActiveX controls. I choose
-
Conversion from higher value to lower
Hi, I have a variable of dec type length 17 which i need to copy in variable of type dec with length 16. Please let me know the shotest solution for the same. <REMOVED BY MODERATOR> Edited by: Alvaro Tejada Galindo on Feb 12, 2008 10:48 AM