Sessions across Web Applications (WARs)
I've heard that you can't share session information (http session) across web applications or war files in the j2ee framework. However, I haven't seen any proof of this? I'm struggling to find information telling that I can't do this. Can someone elaborate a bit?
Thanks.
Hi !
It is TOTALLY WRONG that someone wrote here that a
separate JVM is started for each web-app! No way. Run
any appserver and do a 'ps -ef|grep java' and I bet
you will see only one forever :-). Correct
Steve, it is the classloader hierarchy in all
appservers that prevents you from sharing sessions (i
would say classes loaded by various web-apps). There
is something called a web-app / WAR classloader, which
is 4th in the hierarchy of JVm classloader hierarchy.
Since all your web-app loaded classes are loaded by
this classloader and since each web-app has a "peer"
classloader at same level for its own web-app, you
will never be able to share across web-apps. Incorrect, just because you can have separate classloaders for separate web applications does not mean that those web applications cannot share instances.
It is also possible to have classes which are globally available to ALL web applications which are loaded as part of the servlet container. Tomcat versions 4+ have a common area where classes can be made available. These classes are not loaded within the Web Application classloader at all.
Not only that but it is possible to configure web application contexts such that they can also share things like sessions. This feature is definitely part of the Apache Tomcat release and as this is taken by Sun to be the Reference Implementation of the Servlet Container I would assume that is also part of the J2EE Standard as well.
YOu can always use the DB stuff that other genltmen
has already suggested.
Similar Messages
-
Share graphic layout across web applications (WAR)
Does somebody know how to share graphic layout across web applications?
e.g. how to dynamically include a layout html across multiple webapps, so, if I make a change to that layout,, the change is automatically reflected in all webapplications already deployed.
any idea will be appreciatedHi,
To have a common layout across multiple web applications you can use cascading style sheets (css). By making use of the same style sheet you can have the same appearance in all the web applications. Changing the styles in the css will be reflected in all the pages that make use of this css. The changes wont be effected though in all the already deployed web applications. They will have to be re deployed for the changes to take effect.
Hope this helps you
Cheers
Giri :-)
Creator Team -
Preserve session across web applications.
I've deployed 2 different web applications, each part of their own .ear . Is
there any way to make the two web applications use the SAME session object
? My problem is that when I store an object in the session within one
application, the object isn't available in the session-context for the other
application.
I've also verified that they are actually using two different sessions by
tracking the session-id at script-level. I'm using wl 6.1 if that helps
//Linus Nikander - [email protected]Linus,
We were faced with a similar situation but our team responsible for the
Web applications decided to go with a single web-app in the end and we
bear the cost of not very nice build.
An alternative solution for you will be instead of setting the
authentication in the session to set the user object in a cookie and
then use it for all web applications.
I believe that is the idea behind the Weblogic Identity Assertion
security providers
(http://e-docs.bea.com/wls/docs70/dvspisec/ia.html#1145598) but we've
never had to deal with it yet.
Regards,
Dejan
Linus Nikander wrote:
Thank you for your answer, a few follow-up questions.
As you point out I definitely don't want to implement something that is
outside the spec. and vendor specific. But how then would you suggest
solving the following situation:
At the moment we are co-operating with other actors within a larger project.
Our task is to design and code one of the modules, which consists of EJBs,
JSPs and Servlets. From the beginning this was successfully deployed and
packaged in a single EAR.
Problems arose when we started to integrate our EAR with a WAR written by
one of the other participants in the project. The problem was that they are
responsible for authentication for the whole site, i.e. the login-module.
The've implemented the login so that when a user successfully logs in, a
"user"-object is stored in the session. The very fact that the user-object
exists means that the user is validated. The method for verifying that a
user is authenticated is thus to check the session for the occurence of this
object before execution of any JSP or Servlet. For files within their WAR
this works fine, but as soon as a call is made to a JSP or Servlet within
our EAR the method of authentication breaks because a new session is
generated, void of the user-object.
We've solved the problem by co-deploying a single WAR. In my opinion this is
a really ugly solution because there is no longer a clean separation of
"their" and our files, and it makes deployment a real hassle.
Skipping any points of view as to their chosen method of authentication (we
don't like it either but its going to remain unchanged no matter what), do
you see any other way for us to get things to work where we (hopefully) can
keep our files separate from one another.
//Linus Nikander - [email protected]
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
It would be a violation of the Servlet spec to do so and although in 6.0
you could share the session at least in 7.0 it isn't the case.
I'm not familiar with 6.1 but even if you could do it there then your
application is not going to be portable since you'll be relying on a
specific vendor implementation.
Regards,
Dejan
Linus Nikander wrote:
I've deployed 2 different web applications, each part of their own .ear .
Is
there any way to make the two web applications use the SAME session
object
? My problem is that when I store an object in the session within one
application, the object isn't available in the session-context for the
other
application.
I've also verified that they are actually using two different sessions by
tracking the session-id at script-level. I'm using wl 6.1 if that helps
//Linus Nikander - [email protected] -
Sharing sessions between web applications (WAR files)
I am using weblogic 6.1. The opinion I have read indicates that
sessions cannot be shared between WAR files. That is, I cannot put an
attribute on the session from a servlet/JSP in one WAR file and read
it out from the other. The only justification I've seen is "security".
Now, I find this rather difficult to accept for several reasons:
1. I cannot fathom what kind of "security" would prevent me from
sharing the session between two web applications that I wrote myself.
Let's say I want to write a system that I divide up, for
modularity/separate deployment purposes, into 5 different WAR files.
Why should I not be able to just sign on once and pass that logon
information in the session from one to the other? (I know, I can use
cookies or URL rewriting - but that doesn't seem to be to be a good
solution. And if you can share information through cookies, why not
through sessions?) What about other user information like currently
selected language?
2. Several app servers (iPlanet and I have heard two others) allow you
to share sessions between WARs. Why not weblogic?
Thanks for any information you can give me. I have not been able to
find anything in weblogic documentation about this. If I am
misunderstanding the server capabilities, please enlighten me.
Thanks,
<>< gary
http://www.weblogic.com/docs51/classdocs/webappguide.html
--kumar allamraju
Grant Lewis wrote:
> I'm currently evaluating weblogic and I can't find any references in
> their documentation set stating they support web applications or war
> files. They explicitly state in their docs the Servlet 2.2 specification
> has been supported since version 4.5. I'm evaluating version 5.1. Can
> anybody clear up the confusion for me.
>
> Grant
-
Not able to clear session of web application running inside wpf browser control
Hi,
I have used below code to clear session of web application running inside wpf browser control .
[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
This code is working in Windows 8 but it is not working in windows 7 and windows 8.1.
I want to know why it is not working and how to make it work in windows 7 and windows 8.1
Please help.
Thanks & Regards,
PriteshHi,
I have used below code to clear session of web application running inside wpf browser control .
[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
This code is working in Windows 8 but it is not working in windows 7 and windows 8.1.
I want to know why it is not working and how to make it work in windows 7 and windows 8.1
Please help.
Thanks & Regards,
Pritesh -
Character encoding across Web application contexts
If I submit an HTTP request encoded in SHIFT-JIS across Web application contexts,
the characters seem to get mangled. Do I need to do anything special to pass request
objects that are encoded in SHIFT-JIS to another context.
a. EUC-JP
EUC is Extended Unix Code.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=x-euc-jp">x-euc-jp should be EUC-JP. You use x- for non-registered
encoding names with IANA.
b. JIS
Japanese Industrial Standard
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-2022-jp">To be precise, JIS means nothing. JIS has many standards.
It is an ISO-2022 encoding applied to JIS code sets.
c. Shift_JIS
Microsoft's Japanese encoding method loosly based on
JIS.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=x-sjis">Use "charset=Shift_JIS" in most cases.
>
d. UTF-8You use charset=UTF-8.
- Which one of the above 4 I should use? Either one is fine as long as you include the meta tag
in HTML. If you want to support older generation of
browsers, then skip UTF-8. If you target i-mode
phone browser, use Shift_JIS.
- Do I have to worry about the encoding of the
Japanese data being entered by user in the input
fields in the HTML form?Yes. Use the same encoding as the encoding of the form.
Make sure to call response.setEncoding to set the
enxoding for the parameter processing.
- What should be encoding of the content of html
output generated by the JSP?Use contentType tag in page directive. -
Hi,
In Operations Manager Console 2012 SP1 including RU2 I am trying to record a web session in Web Application Transaction Monitoring.
I have check that:
The add-on (Microsoft Web Recorder Helper) 64bit is Enabled.
The 64bit version of IE10 is running/launched. See this link for how to modify your registry key if needed: http://kevingreeneitblog.blogspot.co.uk/2012/01/scom-2012-recording-web-browser-session.html
I have tried both on a Windows 2008R2 and 2012 server, but the recorder is not showing up as can been seen from Kevin's Blog (link above).
Any Ideas?I managed to get this working on both Windows 8 IE10 and server 2012 IE10. Tested on SCOM 2012 SP1 UR2 and UR3. I've done this process in lab and production several times so hopefully this helps you out.
Checklist:
1. Ensure that the 64bit IE10 is launching when the "start web-capture" is started in SCOM.
2. Enable IE10 internet options:
a: Advanced - Security - Enable Enhanced Protected Mode
b: Advanced - Browsing - Enable third-party browser extensions
3. Close all running IE sessions and open the Registry Editor
4. Registry Change (No reboot needed)
- Browse to the following regkey:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
- Add a new DWORD called TabProcGrowth and set it to 0
5. Registry Change (No reboot needed)
- Browse to the following regkey:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories64\
-You should see two subkeys labeled: (These are the cached BHO IE objects related to the Web Recorder)
{00021493-0000-0000-C000-000000000046}
{00021494-0000-0000-C000-000000000046}
- Delete only the above two mentioned keys (This will force IE to recache them next launch)
6. Try to start the web capture again from SCOM 2012 SP1.
7. When IE10 Launches enable the add-on again if you are prompted.
8. If you still don't see the Web-Recorder pane in IE you can now show it by:
- View - Explorer bars - Web Recorder -
SharePoint 2013 : Content organizer rules to move the document across web applications
Hi,
I wanted to move the document in drop off library to another web application based on the metadata values.I am thinking of doing this using content organizer rules but I am not sure it will help across web application.
Is there any other out of the box or no customization solution to achieve this requirement?Hi Prasad,
According to your description, my understanding is that
you want to move documents across web applications and keep the metadata. Is it right?
For moving documents across web applications, you can use Send To connection to achieve it. However, it may cause some meta data missing.
More information about how to use Send To connection to route documents:
http://www.informit.com/articles/article.aspx?p=2131831&seqNum=4
So, for your issue, I suggest you use a third party tool or solution to do it.
There is a CodePlex solution, check if it is useful for you:
https://spdeploymentwizard.codeplex.com/
Best Regards,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support -
Session sharing across web applications in an EAR File
Hi,
I have an ear file which further has 5 war files. I want to share the same session
object across all these war files in the ear file. Can u pls tell me if this is
possible in weblogic. If yes how?
Thanks,
AkashI'm sorry, by the J2EE 1.3 specification this isn't allowed. I have sent it on
to the servlet team to add as an option but that won't be in time for you. If
you need to share state between them I would probably try and put it in another
place like an EJB or a singleton class in the system classpath.
Sam
[email protected] wrote:
Hi,
I have an ear file which further has 5 war files. I want to share the same session
object across all these war files in the ear file. Can u pls tell me if this is
possible in weblogic. If yes how?
Thanks,
Akash -
Web application .war file
I have a war file with the following structure
index.jsp
WEB-INF/web.xml
WEB-INF/classes (all my servlets here)
WEB-INF/lib (all my application jar files)
The web.xml just defines all the servlets as follows
=================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
<servlet>
<servlet-name> HtmlServlet </servlet-name>
<servlet-class> <PKG PATH>.HtmlServlet </servlet-class>
</servlet>
<servlet>
<servlet-name> ChartServlet </servlet-name>
<servlet-class> <PKG PATH>.ChartServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> HtmlServlet </servlet-name>
<url-pattern> /HtmlServlet </url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name> ChartServlet </servlet-name>
<url-pattern> /ChartServlet </url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
=======================================
WHen I run my application, the index.jsp starts compiling
and throws an error
java.lang.NoClassDefFoundError: org/omg/CORBA/ORB
This class is in one of the jar files in my WEB-INF/lib folder.
What am I missing? Do I have to declare something in my web.xml file or do I need to put that in weblogic.xml? Currently I dont
have any weblogic.xml file.
Thanks,
Bharat NagwaniHi Michael,
I am having the same problem. can you provide more information. I was not
able to find out the answer in the servlet 2.2 specification.
Thanks,
Rob
Michael Girdley wrote:
I believe that you need to register your helper classes in the Web.XML file
in your Web application. Check out the servlet 2.2 specification for more
information.
Thanks,
Michael
Michael Girdley
BEA Systems
Learning WebLogic? http://learnweblogic.com
"bharat nagwani" <[email protected]> wrote in message
news:3a71da38$[email protected]..
I have a war file with the following structure
index.jsp
WEB-INF/web.xml
WEB-INF/classes (all my servlets here)
WEB-INF/lib (all my application jar files)
The web.xml just defines all the servlets as follows
=================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
<servlet>
<servlet-name> HtmlServlet </servlet-name>
<servlet-class> <PKG PATH>.HtmlServlet </servlet-class>
</servlet>
<servlet>
<servlet-name> ChartServlet </servlet-name>
<servlet-class> <PKG PATH>.ChartServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> HtmlServlet </servlet-name>
<url-pattern> /HtmlServlet </url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name> ChartServlet </servlet-name>
<url-pattern> /ChartServlet </url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
=======================================
WHen I run my application, the index.jsp starts compiling
and throws an error
java.lang.NoClassDefFoundError: org/omg/CORBA/ORB
This class is in one of the jar files in my WEB-INF/lib folder.
What am I missing? Do I have to declare something in my web.xml file or doI need to put that in weblogic.xml? Currently I dont
have any weblogic.xml file.
Thanks,
Bharat Nagwani -
Problem deploying a web application (war)
Hello,
I am having a problem deploying a web application in Tomcat.
Here is what happens:
-I copied the war file into the webapps directory.
-I started Tomcat.
-Tomcat automatically expanded the war file into a directory of the same name.
The problem is that I get the following error: "The requested resource (/jadmin) is not available." when I try to access my web application
Can anyone please help?
Thanks in advance,
Balteo.Hi,
check the Tomcat log file <tomcat_dir>/logs/localhost_log.yyyy-mm-dd.txt and see if there is an error corresponding to the deployement of the (/jadmin) context. -
Deploying Java Web Application (WAR-File) into a cluster environment
Hi,
we have a web application which has to read from and write to the file system.
Since a short time we have a cluster environment (2 parallel servers) and since thisa time we have the problem, that files are worked double in the cluster. The application is working on both servers now and so we have this problem.
Does anybody know how we have to deploy the application correctly in a cluster environment or do we have to change anything in our source code of the application?
I didn't find any documentation about this.
At the moment we have deployed the application on one of the two servers only, but I think there must be a better way to solve this problem.
Thanks for your replies.
Regards
ThorstenHi,
I think first you need to wrap it into an EAR file, then you can deploy it.
As far as I know standalone deployment of WAR is deprecated as of 640.
similar threads:
How to deploy .war on NWDI
Deploying an existing WAR file into the Portal
Hopefully this tutorial also gives some idea:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/70/13353094af154a91cbe982d7dd0118/frameset.htm
Regards,
Ervin -
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)
>
>
>
-
Unique Session en web application?? How?
How can i to force in my web application that my clients can only loggon one time at same time?, local vars in the application? if the client shutdown de PC?, i use OID for authentication, any way?
Any data, url?
ThanksYou basically have to keep track of who is logged in yourself. Use an HttpSessionBindingListener to make sure you are notified when a session expires, so you can let the user back in.
-
Maintaining session among Web Applications
Hi!
I would like to know if there is a good solution for this purpose: maintain the session in three, four or more web applications.
We know that if a user navigates through the pages that belong to only one of the web apps, the session can possibly expire in other web apps. What would be a good strategy to eliminate this problem?
I was thinking about a solution in which for each request the user does, or in other words, for each submit the user executes, I would call other servlets located in the other Web apps, and such servlets would have only this objective, that is maintaining the session, but I�m not sure whether it is really the best way.
Any thoughts?
Thanks.SSO will be a good options, using some available products, e.g, Sun Access Manager, or you can go for Webservices, with token management.
Maybe you are looking for
-
Returning newly created IDs from View with Instead Of
Hi All, I have the following table: CREATE TABLE TBLSIM_SUPPLIER_H "SS_ID" NUMBER(10,0) NOT NULL ENABLE, "SS_GUID" NVARCHAR2(36) NOT NULL ENABLE, "SS_NAME" NVARCHAR2(50) NOT NULL ENABLE, "SS_H_IS_ACTIVE" NUMBER(1,0) DEFAULT 1 NOT NULL
-
Recommenadation for small external drive
I travel a fair bit, and am looking for a small (100-160 GB) drive that I can use for editing movies when on the road. I do have a larger external 250 GB firewire drive at home, but it's a bit cumbersome for travel purposes. Is there a small external
-
Is it possible to join an open path with a closed path?
I am using Illustrator to show territorial changes to Germany after World War I. My problem is this: I need to join an open path to a closed path. With the pencil tool I drew a blue line to illustrate the Rhine river on an SVG map of Weimar Germany.
-
Sync problem - songs appearing in wrong order
Have been using Ipod classic with Itunes for several months with no problems. A couple of weeks ago I connected Ipod to my PC to sync and charge. rather than just putting recently added music onto my ipod as per usual, it proceeded to transfer my ful
-
[Solved] Rxvt-Unicode-256colors , -pe tabbed extension problem.
Hello. I use rxvt-unicode-256colors for long time. Wheb try to run -pe tabbed extension I got following errors: iurxvt: Can't call method "parent" on an undefined value at /usr/lib/urxvt/perl/tabbed line 82. urxvt: Can't call method "focus_in" on an