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 PM
Because 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
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 -
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. -
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 questionThe 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) -
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 -
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 -
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)
>
>
>
-
How do I get info from Active Directory and use it in my web-applications?
I borrowed a nice piece of code for JNDI hits against Active Directory from this website: http://www.sbfsbo.com/mike/JndiTutorial/
I have altered it and am trying to use it to retrieve info from our Active Directory Server.
I altered it to point to my domain, and I want to retrieve a person's full name(CN), e-mail address and their work location.
I've looked at lots of examples, I've tried lots of things, but I'm really missing something. I'm new to Java, new to JNDI, new to LDAP, new to AD and new to Tomcat. Any help would be so appreciated.
Thanks,
To show you the code, and the error message, I've changed the actual names I used for connection.
What am I not coding right? I get an error message like this:
javax.naming.NameNotFoundException[LDAP error code 32 - 0000208D: nameErr DSID:03101c9 problem 2001 (no Object), data 0,best match of DC=mycomp, DC=isd, remaining name dc=mycomp, dc=isd
[code]
import java.util.Hashtable;
import java.util.Enumeration;
import javax.naming.*;
import javax.naming.directory.*;
public class JNDISearch2 {
// initial context implementation
public static String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
public static String MY_HOST = "ldap://99.999.9.9:389/dc=mycomp,dc=isd";
public static String MGR_DN = "CN=connectionID,OU=CO,dc=mycomp,dc=isd";
public static String MGR_PW = "connectionPassword";
public static String MY_SEARCHBASE = "dc=mycomp,dc=isd";
public static String MY_FILTER =
"(&(objectClass=user)(sAMAccountName=usersignonname))";
// Specify which attributes we are looking for
public static String MY_ATTRS[] =
{ "cn", "telephoneNumber", "postalAddress", "mail" };
public static void main(String args[]) {
try { //----------------------------------------------------------
// Binding
// Hashtable for environmental information
Hashtable env = new Hashtable();
// Specify which class to use for our JNDI Provider
env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
// Specify the host and port to use for directory service
env.put(Context.PROVIDER_URL, MY_HOST);
// Security Information
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, MGR_DN);
env.put(Context.SECURITY_CREDENTIALS, MGR_PW);
// Get a reference toa directory context
DirContext ctx = new InitialDirContext(env);
// Begin search
// Specify the scope of the search
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
// Perform the actual search
// We give it a searchbase, a filter and the constraints
// containing the scope of the search
NamingEnumeration results = ctx.search(MY_SEARCHBASE, MY_FILTER, constraints);
// Now step through the search results
while (results != null && results.hasMore()) {
SearchResult sr = (SearchResult) results.next();
String dn = sr.getName() + ", " + MY_SEARCHBASE;
System.out.println("Distinguished Name is " + dn);
// Code for displaying attribute list
Attributes ar = ctx.getAttributes(dn, MY_ATTRS);
if (ar == null)
// Has no attributes
System.out.println("Entry " + dn);
System.out.println(" has none of the specified attributes\n");
else // Has some attributes
// Determine the attributes in this record.
for (int i = 0; i < MY_ATTRS.length; i++) {
Attribute attr = ar.get(MY_ATTRS);
if (attr != null) {
System.out.println(MY_ATTRS[i] + ":");
// Gather all values for the specified attribute.
for (Enumeration vals = attr.getAll(); vals.hasMoreElements();) {
System.out.println("\t" + vals.nextElement());
// System.out.println ("\n");
// End search
} // end try
catch (Exception e) {
e.printStackTrace();
System.exit(1);
My JNDIRealm in Tomcat which actually does the initial authentication looks like this:(again, for security purposes, I've changed the access names and passwords, etc.)
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://99.999.9.9:389"
connectionName="CN=connectionId,OU=CO,dc=mycomp,dc=isd"
connectionPassword="connectionPassword"
referrals="follow"
userBase="dc=mycomp,dc=isd"
userSearch="(&(sAMAccountName={0})(objectClass=user))"
userSubtree="true"
roleBase="dc=mycomp, dc=isd"
roleSearch="(uniqueMember={0})"
rolename="cn"
/>
I'd be so grateful for any help.
Any suggestions about using the data from Active directory in web-application.
Thanks.
R.VaughnBy this time you probably have already solved this, but I think the problem is that the Search Base is relative to the attachment point specified with the PROVIDER_URL. Since you already specified "DC=mycomp,DC=isd" in that location, you merely want to set the search base to "". The error message is trying to tell you that it could only find half of the "DC=mycomp, DC=isd, DC=mycomp, DC=isd" that you specified for the search base.
Hope that helps someone.
Ken Gartner
Quadrasis, Inc (We Unify Security, www -dot- quadrasis -dot- com) -
PS CS4 64-bit (in Web Premium CS4) on Win 7 PC. I did a duplicate file check on my hdd and deleted dup files. Now when I try to run PS 64-bit I get "Some of the application components are missing from the Application directory, Please reinstall the application." When I do this, it seems to install correctly until the very end, then it says "Installation Complete With Errors", and when I try to run I get the same 'component missing message'. What can I do? PS 32 bit runs fine. Some of the other applications ib Web Premium say the shortcut has been changed or removed. I appreciate your help...Thank you
Best advice I can think of is to uninstall and run the Clean Script from here.
Adobe - Adobe CS4 Clean Script -
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 -
Correct Directory Structure for Serving a Web Application from Arch?
At the moment I have an Apache web server hosting PHP based web pages out of /srv/http. This works for what I am doing at the moment, but i was wondering if there was a more professional\correct way to host a web application on Arch.
When would someone host a page in /srv/http vs /var/www ? ( is /www even widely used on archlinux) ?
Or is their a better way all together ( I read something about symbolic linking the 2 directories)?
Can anyone provide a sample of how they decided to set up their basic web directories ?
Any help is very much appreciated !It mainly depends on the webserver you're using. There's nothing about the difference between /srv/http versus /var/www. As far as the web user is concerned they don't even know what directory structure you're using.
-
How to set a root directory for file management in web application
Is it possible to set a default root directory for file management for a web application ?
We would upload some files and store them in the web server.
When we write the uploaded files without any path, the files are written in the config directory into the jdeveloper embedded oc4j directory.
When we write the uploaded with a relative path ("/somedir/filename"), the files are written in C:/somedir/filename.
We would like that all file management with relative path into the web application refer automatically to a given root directory (for example defined in web.xml).
Is it possible ?I'm using the standard upload in adf faces.
The problem is not during upload. This is managed in a temporay directory defined in web.xml. The problem is for writing the file that was uploaded (upload give us an inputStream we have to write somewhere, eventually after unzipping).
Here is an example of our current code.
if (mimeType.equals("application/x-zip-compressed") |
mimeType.equals("application/zip")) {
File destZipFile =
new File(rootDirectory + "/" + parametersDirectory +
"/" + uploadedFile.getFilename());
BufferedInputStream isZipFile =
new BufferedInputStream(uploadedFile.getInputStream());
FileOutputStream fosZipFile =
new FileOutputStream(destZipFile);
BufferedOutputStream bosZipFile =
new BufferedOutputStream(fosZipFile, BUFFER);
// read and write until last byte is encountered
while ((currentByte = isZipFile.read(data, 0, BUFFER)) !=
-1) {
bosZipFile.write(data, 0, currentByte);
} -
Obtaining root directory of web application
Hi all.
I am beginer in web application developing. You probably know how it is. Problem after problem:)
So I started developing in JSF using NetBeans 6.0 with Tomcat 6.0.14 and i have the folowing problem:
How can I programically get the root directory of my web application? I need it because I use some kind of filter, which redirects to error page, when unauthorized user tries to access protected resources. This error page is in root directory of my web application and has commandLink to logging site (action is set for method, which returns some string and navigation is defined for this string in facesconfig.xml), which is also in root directory. When I want to access for example /restricted/user/userPage.jsp and I am not logged in, the error page is displayed, but command link does not work. I supose the is a problem in current directory which is probably set for /restricted/user/.
Thank You for any clues.
Regards,
Jahn GurdaHello!
I am also new to web applications and JSF. But I can tell you that its a little hard to programically achieve the security you want to achieve i.e. displaying some error page if the user is not logged in, however you can do it relatively easily using web.xml or sun-web.xml files by defining some roles, filters etc.
I read that somewhere, try searching on Google...I have not implemented that myself.
As far as obtaning the root directory of web application is concerned you may try following in your button_action method or any where in Page Bean class:
ServletContext theApplicationsServletContext = (ServletContext) this.getExternalContext().getContext();
String rootPath = theApplicationsServletContext.getRealPath("/");Then use "rootPath" where ever you want, it contains the path of the root directory.
It atleast works for me.....
Its strange that no one has answered this query for so long. Hope someone does early, I also want the clear answer.
Thanks!
Edited by: T.B.M on Oct 20, 2008 12:45 AM -
How to avoid directory listing in java web applications.
how to avoid directory listing in java web applications.
That is on typing the url of the application it should not the directory listing. Welcome tag in web.xml doesnot fully solve the problem, since still the images folder etc is still accessibleI know of two ways.
If you're using tomcat and have access to the conf directory.
Edit your $TOMCAT/conf/web.xml. Find your default servlet properties and change
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>to <servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>And restart your server. This will affect every directory on the server, and return a 405 directory browsing forbidden error.
Another way, is to place an index.jsp inside each directory with a simple one line redirect to your applications CONTEXT_PATH.response.sendRedirect("http://yourserver/yourapp/");This will only affect specific directories which contain these index.jsp files.
Hope this helps
Maybe you are looking for
-
Error in Asset Transactions Report in ECC 6
Hi Friends, We have upgraded from ECC 4.7 to ECC 6.0 in Nov 2007. In Asset Transactions Report (S_ALR_87012048) the Depreciation column is displaying Zero Values for individual line items after November 2007 (ie for Assets posted after Nov, 07). We p
-
ORA-06502 trying to load a long raw into a variable.
Hi. In my table "banco_imagem" the bim_src column is a long raw type. I´m using oracle forms 6 (not 6i), so I can´t use blob type to save my images. Now I´m trying to load the long raw column into a variable in a package that runs on 10g. I´m trying
-
Need a dificult script can't to it myself.
Hello, I try to keep it short. We have a new idea for a customer of ours. Don't know if it's possible and I hope there is someone that's want to try it and give it a go. I can work it out on paper altough my applescript / programmer skills want do th
-
Fatal error in startNodeManager.sh
I when I try to start the node manager I obtain the following error: <Fatal error in node manager server> java.net.UnknowHostException: startNodemanager.sh thanks any help
-
Hi All, Please find the details below: Transaction CJ20N Program (screen) SAPLMLSP Screen number 200 Program (subscreen) SAPLMLSP Screen number 400 Program (GUI) SAPLMLSP GUI st