WLS 5.1 sp8 servlet problems
Ok. I must be just plain stupid..... :-(
My environment:
Win2K advanced server
IIS 5.0
WLS 5.1 sp8
jdk 1.3
standard install directories. The only changes were to use the 1.3 jdk.
I can get jsps to run out of the /public_html/ directory. I've configured
iisproxy to proxy .jhtml, .jsp, and .svlt file extensions ( the .svlt for
servlets :-) ).
The server runs, the console runs, everything seems to be Ok, except, I
can't figure out how to run even the example SnoopServlet. The
weblogic.properties file has the examples registered defaulted.
I also get an evaluation period over on the cloudscape database, when the
server is starting up. So even the BigTel app has problems with the
database.
I also get that same missing javai.dll on startup. It does jump to the
interpreter though. I've seen the explanation on the javai.dll and can
accept that it will be fixed in sp9. I don't understand the cloudscape
thing. And for the life of me I can't figure out how to get the SnoopServlet
to run.
I'm running the version of WLS 5.1 that comes with Visual Cafe EE 4.0. and
have patched it up to sp8.
I thought that by adding the .svlt extension that the iisproxy would call
the Servlet. As in:
http://localhost/SnoopServlet.svlt would call the SnoopServlet from the
examples.
Any help would be appreciated.
George
Hi George,
Are you having fun yet? :-)
George Smith wrote:
Ok. I must be just plain stupid..... :-(
My environment:
Win2K advanced server
IIS 5.0
WLS 5.1 sp8
jdk 1.3
standard install directories. The only changes were to use the 1.3 jdk.
I can get jsps to run out of the /public_html/ directory. I've configured
iisproxy to proxy .jhtml, .jsp, and .svlt file extensions ( the .svlt for
servlets :-) ).
The server runs, the console runs, everything seems to be Ok, except, I
can't figure out how to run even the example SnoopServlet. The
weblogic.properties file has the examples registered defaulted.The registeration in the weblogic.properties file looks like this:
weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
You can access it directly using the URL
http://myweblogic.machine.name:7001/snoop
In order to get IIS to proxy this appropriately, you need to specify the .svlt
extension to the URL. However, the above registration does not use this
extension so WLS will not find the servlet if append the extension. Therefore,
you need to do one of the following (but not both):
1.) Change your servlet registration to look like this:
weblogic.httpd.register.snoop.svlt=examples.servlets.SnoopServlet
2.) Change your IIS configuration to proxy by path. For example, configure IIS
to proxy all URLs with /weblogic using the WLForwardPath parameter and the
PathTrim parameter value of /weblogic. This will allow you to enter the
following URL in the browser:
http://myweblogic.machine.name:7001/weblogic/snoop
IIS will forward this because of the /weblogic but it will trim the URL to
/snoop before forwarding it to WLS (allowing WLS to find the servlet registered
with weblogic.httpd.register.snoop=examples.servlets.SnoopServlet).
I also get an evaluation period over on the cloudscape database, when the
server is starting up. So even the BigTel app has problems with the
database.Download and install the Cloudscape updater from the WebLogic 5.1.0 Service Pack
area.
I also get that same missing javai.dll on startup. It does jump to the
interpreter though. I've seen the explanation on the javai.dll and can
accept that it will be fixed in sp9. I don't understand the cloudscape
thing. And for the life of me I can't figure out how to get the SnoopServlet
to run.Hmm... I thought that the reason for the javai.dll thing was because you were
picking up a different version of some JDK files (javai.dll is from JDK 1.1.x).
I'm running the version of WLS 5.1 that comes with Visual Cafe EE 4.0. and
have patched it up to sp8.
I thought that by adding the .svlt extension that the iisproxy would call
the Servlet. As in:
http://localhost/SnoopServlet.svlt would call the SnoopServlet from the
examples.
Any help would be appreciated.
GeorgeHope this helps,
Robert
Similar Messages
-
WLS 7.0 sp2 - Servlet Problems with SOAP messages
I'm using Weblogic 7.0 SP2 and trying to create a Servlet to receive SOAP wrapped
XML messages. I'm getting the following error. Is this a problem with WLS7.0sp2's
support of JAXM? The System.out.println's indicate I have successfully received
the incoming SOAP request and then successfully formatted the SOAP response, but
upon returning saving the response it appears to blow up. Does anyone have any
suggestions?
I need to do the following in a servlet:
- receive an incoming SOAP request with an embedded XML message
- perform some processing
- return a SOAP response with an embedded XML message
Should I be using JAXM? Or can I do this same task easily with JAX-RPC?
<Feb 24, 2004 4:10:42 PM AST> <Error> <HTTP> <101017> <[ServletContext(id=260434
7,name=isd.war,context-path=)] Root cause of ServletException
java.lang.Error: NYI
at weblogic.webservice.core.soap.SOAPMessageImpl.saveRequired(SOAPMessag
eImpl.java:360)
at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:5445)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>
I've stripped the code down so that all it does is verifies the incoming SOAP/XML
request and creates a hard-coded response... be gentle... I'm a novice at this
import javax.xml.soap.*;
import javax.servlet.*;
import javax.servlet.http.*;
// import javax.xml.transform.*;
import java.util.*;
import java.io.*;
public class RegisterServlet extends HttpServlet
static MessageFactory fac = null;
static
try
fac = MessageFactory.newInstance();
catch (Exception ex)
ex.printStackTrace();
public void init(ServletConfig servletConfig) throws ServletException
super.init(servletConfig);
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException
try
System.out.println("** Note: doPost() Entering req = " + req);
// Get all the headers from the HTTP request
MimeHeaders headers = getHeaders(req);
// Get the body of the HTTP request
InputStream is = req.getInputStream();
// Now internalize the contents of a HTTP request
// and create a SOAPMessage
SOAPMessage msg = fac.createMessage(headers, is);
System.out.println("** Note: doPost() Step A");
SOAPMessage reply = null;
reply = onMessage(msg);
System.out.println("** Note: doPost() Step B reply = " + reply);
if (reply != null)
* Need to call saveChanges because we're
* going to use the MimeHeaders to set HTTP
* response information. These MimeHeaders
* are generated as part of the save.
if (reply.saveRequired())
System.out.println("** Note: doPost() Step C reply.saveRequired()");
reply.saveChanges();
resp.setStatus(HttpServletResponse.SC_OK);
putHeaders(reply.getMimeHeaders(), resp);
// Write out the message on the response stream
OutputStream os = resp.getOutputStream();
System.out.println("** Note: doPost() Step D os = " + os);
reply.writeTo(os);
os.flush();
else
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
catch (Exception ex)
throw new ServletException("** Error: SAAJ POST failed: " + ex.getMessage());
static MimeHeaders getHeaders(HttpServletRequest req)
Enumeration enum = req.getHeaderNames();
MimeHeaders headers = new MimeHeaders();
while (enum.hasMoreElements())
String headerName = (String)enum.nextElement();
String headerValue = req.getHeader(headerName);
StringTokenizer values =
new StringTokenizer(headerValue, ",");
while (values.hasMoreTokens())
headers.addHeader(headerName,
values.nextToken().trim());
return headers;
static void putHeaders(MimeHeaders headers, HttpServletResponse res)
Iterator it = headers.getAllHeaders();
while (it.hasNext())
MimeHeader header = (MimeHeader)it.next();
String[] values = headers.getHeader(header.getName());
if (values.length == 1)
res.setHeader(header.getName(),
header.getValue());
else
StringBuffer concat = new StringBuffer();
int i = 0;
while (i < values.length)
if (i != 0)
concat.append(',');
concat.append(values[i++]);
res.setHeader(header.getName(), concat.toString());
// This is the application code for handling the message.
public SOAPMessage onMessage(SOAPMessage message)
SOAPMessage replymsg = null;
try
System.out.println("** Note: OnMessage() Entering msg = " + message);
//Extract the ComputerPart element from request message and add to reply SOAP
message.
SOAPEnvelope reqse = message.getSOAPPart().getEnvelope();
SOAPBody reqsb = reqse.getBody();
//System.out.println("** Note: OnMessage() Step B");
System.out.println("** Note: OnMessage () Step A Soap Request Message Body = "
+ reqsb);
//Create a reply mesage from the msgFactory of JAXMServlet
System.out.println("** Note: OnMessage () Step B");
replymsg = fac.createMessage();
SOAPPart sp = replymsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
System.out.println("** Note: OnMessage () Step C Soap Reply Before Message Body
= " + sb);
se.getBody().addBodyElement(se.createName("RegisterResponse")).addChildElement(se.createName("ErrorCode")).addTextNode("000");
System.out.println("** Note: OnMessage () Step D Soap Reply After Message Body
= " + sb);
replymsg.saveChanges();
System.out.println("** Note: OnMessage() Exiting replymsg = " + (replymsg));
catch (Exception ex)
ex.printStackTrace();
return replymsg;
Michael,
I got the same error on WLS8.1/Win2K professional and apache FOP (old version).
After digging into the WLS code and FOP(old version). i found the conflict happens
on
the "org.xml.sax.parser" system property. In WLS code, they hard coded like the
following when startup weblogic server:
System.setProperty("org.xml.sax.parser", "weblogic.xml.jaxp.RegistryParser");
But the FOP code try to use the "org.xml.sax.parser" system property to find the
sax parser then conlict happens.
Here is the response from BEA support :
"I consulted with our developers regarding the question of whether we can change
the hard-coded value for the java system property: org.xml.sax.parser by using
a configuration parameter and I found that unfortunately there is no specific
setting to change the value. As you had mentioned in your note the org.xml.sax.parser
system property can be changed programmatically in your application code."
I solve my problem by using newer apache FOP (it never use the system property:org.xml.sax.parser
any more) and XML Registy for WLS8.1.
Good luck.
David Liu
Point2 Technologies Inc.
"p_michael" <[email protected]> wrote:
>
Help.
When we migrated from WLS 6.1 to WLS 7.0 SP2 when encountered a problem
with XML
parsing that did not previously exist.
We get the error "weblogic.xml.jaxp.RegistryParser is not a SAX driver".
What does this mean? And, what should we do about it.
p_michael -
WLS 5.1 SP8 Clustering problems
Hi all,
I am trying to create a cluster with 2 instances of WLS and third WLS
instance to be used as a proxy. The two servers in the cluster have joined
the Multicast Address correctly (I hope, because thats what the log file
says). Now the proxy also started succesfully. But when I make a request
for a JSP page, it is going into an infinite loop. The request is not going
beyond the proxy i think, because, on the proxy, it says *.jsp:init.
Then i tried to use ISAPI plug-in to call this JSP, but i am getting an
ISAPI error (I don't know why it is looking for localhost:7001 when I have
specified
WebLogicCluster=192.200.1.251:7001,192.200.1.252:7001,192.200.1.253:7001
in the iisproxy.ini File:
Internal Server Error
Reason:Cannot connect to WebLogic: timed out after 10 seconds. Cluster list:
localhost:7001
Line 427 of iisproxy.cpp
Can Some one help ?
Thank You in advance.
Ramesh
Seems ISAPI plugin could not locate iisproxy.ini.
Here is the search order:
- current directory (same as the dll)
- WebLogic installation directory (finds it from the regirstry) -
c:\weblogic
Try to save iisproxy.ini at the same location of the dll.
"ramesh" <[email protected]> wrote in message
news:[email protected]...
> Hi all,
>
> I am trying to create a cluster with 2 instances of WLS and third WLS
> instance to be used as a proxy. The two servers in the cluster have
joined
> the Multicast Address correctly (I hope, because thats what the log file
> says). Now the proxy also started succesfully. But when I make a request
> for a JSP page, it is going into an infinite loop. The request is not
going
> beyond the proxy i think, because, on the proxy, it says *.jsp:init.
>
> Then i tried to use ISAPI plug-in to call this JSP, but i am getting an
> ISAPI error (I don't know why it is looking for localhost:7001 when I have
> specified
> WebLogicCluster=192.200.1.251:7001,192.200.1.252:7001,192.200.1.253:7001
> in the iisproxy.ini File:
>
> Internal Server Error
> Reason:Cannot connect to WebLogic: timed out after 10 seconds. Cluster
list:
> localhost:7001
> Line 427 of iisproxy.cpp
>
> Can Some one help ?
>
> Thank You in advance.
>
> Ramesh
>
>
>
-
WLS 5.1 SP8 improper load balancing of EJB
I have noticed a strange behaviour in load balancing of EJB.
I have 3 instances of WLS 5.1 sp8 running under a cluster, lets say X, Y and
Z. Now if I access the EJB in the cluster from with in one of the WLS
instances(eg servlet), lets say Y, then I always get the reference from that
same machine "Y" no matter what load balancing algorithm I set. No matter
how many times I access this EJB from machine Y it will only give me
reference of EJB from Y. Somehow this seems wrong, it should round-robin
between X, then Y then Z and then X again no matter where I get a reference
from.
Now if I access the EJB from outside of the cluster, a fourth JVM, then each
time I get the reference from a different machine and clustering works fine
and load balances as expected.
Any explanation, workaround ??? Most of the EJB referencing we are doing is
within the cluster itself, this is causing problems because everything
works, but on a single machine even though we have a cluster set up. We only
reference the EJB externally once, that does get clustered, but from that
point on, everything happens on that machine.
What you really want to do is use CallRouter - I've used it with clustered RMI,
I have not used it with EJB. (but EJB use RMI so you should be able to make it
work).
Personally, I'd be writing my number crunching bits in C about now.
Mike
"Haider Kazmi" <[email protected]> wrote:
>Thanks Mike, let me give creating InitialContext with specific IP address
>a
>try , maybe we can put in load sharing logic in our code this way.
>
>As for using C, I think as with all products, our marketing team wouldn't
>like that but thats a definate approach to improve performance.
>
>cheers
>
>"Mike Reiche" <[email protected]> wrote in message
>news:[email protected]...
>>
>> You're doing heavy computation in Java - it's going to be slow.
>> Write it in C, call it using JNI and it will be about 10 times as fast.
>>
>> There 'executing sequentially' is not a function of the EJB
>specification. I
>> assume your code looks something like...
>>
>>
>> result1= ejb1.calculate1 ( a, b, c );
>> result2= ejb2.calculate2 ( e, f, result1);
>> result3= ejb3.calcualte3 ( x, result3);
>>
>> caculate3 won't be called until calculate2 has finished, which won't
>be
>called
>> until calculate1 has finished. Sequential.
>>
>> If you really want to force the EJBs on a specific WL instance, just
>specify the
>> IP address and port number when you create the InitialContext.
>>
>> Mike
>>
>>
>>
>> "Haider Kazmi" <[email protected]> wrote:
>> >Hi Mike
>> >
>> >> First you gotta understand that calling an EJB on a remote JVM costs
>> >about
>> >10 times
>> >> as much as calling one on a local instance. That's what I tried
>to
>> >say in
>> >the
>> >> first followup.
>> >>
>> >> Second, if whatever is calling the EJB (JSP, Servlet) is load balanced,
>> >then -
>> >> presto - all the EJB calls are load balanced as well.
>> >
>> >Thats definately true, I think I might have created some confusion,
>what
>> >I
>> >was really trying to say is that we are doing a lot of processing
>and
>> >its
>> >mathematical in nature unlike the standard credit card transaction
>or
>> >website transaction. We have optimized this to a large extent, the
>real
>> >problem we get into is when the consumers of this result try to consume
>> >them, each of which are stateless session beans.
>> >The result gets posted on a JMS topic, servlet was an example, what
>we
>> >actually have are JMS clients calling more EJBs once a result is posted
>> >on
>> >the JMS topic. So here is how it goes, once the processing of workflow
>> >is
>> >done, this published on the relevent JMS topic based on the result
>of
>> >the
>> >workflow process. All the related JMS clients subscribed to this topic
>> >pick
>> >it up. They call relevent EJBs with this result. So we don't have
>control
>> >over load balancing our clients.
>> >
>> >> The only time that such a configuration would load only one instance
>> >is if
>> >you
>> >> only had one such EJB call at a time. But this is still faster
>than
>> >having the
>> >> EJBs load balanced on remote JVM. Load balanced or not, the EJB
>calls
>> >are
>> >NOT
>> >> made in parallel, thus the calling method has to wait for the first
>> >call
>> >to finish,
>> >> then the second, then the third... so that if each call takes longer
>> >on a
>> >remote
>> >> JVM than locally, your total wait time is longer.
>> >thanks for this info. I think I better read the EJB specs in more
>details.
>> >however whats not clear to me is even if the EJBs are different (not
>> >just
>> >different instances of the same EJBs and what about different instances
>> >of
>> >the same EJB, are things still done sequentially) will only one method
>> >be
>> >called at a time??
>> >
>> >> Maybe that's not clear - distributing the calls does not make anything
>> >happen
>> >> any faster - it just spreads it out.
>> >Is this also true for stateless session beans, specifically among
>different
>> >instances of the same bean?
>> >
>> >> You should be spending your time figuring out how to reduce the
>amount
>> >of
>> >processing.
>> >This is where I am stuck at now. We are at a point where a lot of
>the
>> >optimization is done. The problem arizes when processing is done and
>> >the
>> >result is posted on the JMS, a bunch of stateless session bean try
>to
>> >consume the result all at once.
>> >
>> >
>>
>
>
-
Servlet reloading not working with WLS 5.1 sp8
I downloaded and installed WLS 5.1's sp8 to fix the "java.net.SocketException: Connection aborted by peer: socket write error"
problem. Although that problem is fixed, I have found that, however, the servlet (automatic) reloading does not
work anymore. If I remove the sp8 from my Java system classpath and WL classpath (i.e. not using sp8), then
the servler reloading works fine.
Does anybody experience similar problem or have I forgot to do something?
WLS properties/env vars setting:
- weblogic.httpd.servlet.reloadCheckSecs=0
- WEBLOGIC_CLASSPATH=%WEBLOGIC_HOME%\lib\weblogic510sp8.jar;...
- JAVA_CLASSPATH=%WEBLOGIC_HOME%\lib\weblogic510sp8boot.jar;...
Thanks in advance for any help.
I've experienced the same problem with both sp6 and sp8. In both cases I performed several test, including
- varied the value of weblogic.httpd.servlet.reloadCheckSecs
- changes to the package depth the servlet belonged to
- changes to the string length of the package names the servlet belonged to
At best, the servlet would reload sometimes. I've moved back to sp5 and the problem has subsided.
Note: I did not try registering the servlet to see how that would effect the dynamic reloading.
Hope this helps
- Dave
"Michel Dinh" <[email protected]> wrote:
>
>I downloaded and installed WLS 5.1's sp8 to fix the "java.net.SocketException: Connection aborted by peer: socket write error"
>problem. Although that problem is fixed, I have found that, however, the servlet (automatic) reloading does not
>work anymore. If I remove the sp8 from my Java system classpath and WL classpath (i.e. not using sp8), then
>the servler reloading works fine.
>
>
>Does anybody experience similar problem or have I forgot to do something?
>
>WLS properties/env vars setting:
>
>- weblogic.httpd.servlet.reloadCheckSecs=0
>- WEBLOGIC_CLASSPATH=%WEBLOGIC_HOME%\lib\weblogic510sp8.jar;...
>- JAVA_CLASSPATH=%WEBLOGIC_HOME%\lib\weblogic510sp8boot.jar;...
>
>Thanks in advance for any help.
-
Servlet Registration/Forwarding Question in WLS 5.1 SP8
Here is my problem....
The request coming to WL server is http://localhost:7003/?id=11
How do I configure weblogic so that it sends the all these requests(starting with
a '?')
to a particaular Servlet?
(I know how to set up a servlet to handle all html rquests..
weblogic.httpd.register.*.html=com.mydomain.web.MyServlet)
Any help would be appreciated.
Thanks,
You'll have to bind "/" to the selected servlet in the web.xml.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"Kailu" <[email protected]> wrote in message
news:3b781f99$[email protected]..
>
> Here is my problem....
> The request coming to WL server is http://localhost:7003/?id=11
>
> How do I configure weblogic so that it sends the all these
requests(starting with
> a '?')
> to a particaular Servlet?
> (I know how to set up a servlet to handle all html rquests..
> weblogic.httpd.register.*.html=com.mydomain.web.MyServlet)
>
> Any help would be appreciated.
>
> Thanks,
-
Re-login problem with WLS 5.1 sp8
Hi,
I have a re-login problem with a war servlet: user called reader does not have
viewing access to all views of a web interface. When she tries to access those
views a new login dialog comes up as should. The problem is that this new dialog
does not accept power user login as I would like it to! Any ideas how to change
the configuration in either web.xml or weblogic.properties file to make it work?
In Tomcat environment it works.
BR JukkaHi,
I have a re-login problem with a war servlet: user called reader does not have
viewing access to all views of a web interface. When she tries to access those
views a new login dialog comes up as should. The problem is that this new dialog
does not accept power user login as I would like it to! Any ideas how to change
the configuration in either web.xml or weblogic.properties file to make it work?
In Tomcat environment it works.
BR Jukka -
JSF 2 and Primefaces with WLS 11gR1(10.3.6) problem
Hi all,
I would like to create a web application in OEPE, which uses JSF 2 and Primefaces 3.2 and then deploy & develop onto WLS.
I added the primefaces jar to WEB-INF/lib.
See my publishing stacktrace below.
(I tried using the Shared JSF libraries and including jsf-api and impl in WEB-INF/lib, but neither of these options worked.)
Do you have any ideas what I am doing wrong? Thanks,
András Liter
<2012.04.14. 21:32:21 CEST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:309)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200)
at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3225)
at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:247)
at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461)
at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1545)
at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:509)
at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387)
at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141)
at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206)
at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547)
at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192)
at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184)
at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:677)
at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:63)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:149)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
<2012.04.14. 21:32:21 CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1334431938841' for task '32'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1520)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: java.io.FileNotFoundException: \Oracle\Middleware\Oracle_OSB1\soa\connectors\FileAdapter.rar!fileAdapter.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at com.sun.faces.facelets.util.Classpath.getAlternativeJarFile(Classpath.java:252)
Truncated. see log file for complete stacktraceHi --
I just tried using OEPE 11.1.1.8.0 against a WLS 10.3.6.0 install to build and deploy a JSF 2.0 application and it worked successfully.
The project is here if you want to take a look:
http://dl.dropbox.com/u/15657493/oepe-test-jsf2.zip
The only minor gotcha I found was that I needed to reorder the libraries on the project so that the Shared-Library[jsf] was higher than the WebLogic System Library - this then let me use the JSF 2.0 programming API successfully instead of the 1.2 version that is included in the WLS System Library.
Here's a couple of screen shots of the facet and project as well as the overall development environment:
http://dl.dropbox.com/u/15657493/oepe-jsf-facet.png
http://dl.dropbox.com/u/15657493/oepe-project-libs.png
http://dl.dropbox.com/u/15657493/oepe.png
For that zip file error, one thing perhaps is to Check your CLASSPATH setting to see if it has an entry for that FileAdapter.rar. I don't know why it's causing that problem but if it's in the CLASSPATH try removing it and then starting the server. -
WLS 5.1 SP8 clustered machines do not acknowledge each other on startup
I have made this posting in In-Memory-replication group also.
We are trying to setup a cluster with two machines A & B. These
are Solaris boxes with WLS 5.1 and SP8. The servers are multi-homed.
When the two Weblogic servers are started concurrently, their logs
show that they joined at the designated multicast IP 225.225.225.225.
But at the end of startup process they do not give the usual "Adding
server .....................to cluster view" message.
I am able to ping each machine from the other.
I have also run MulticastTest utility and the message packets are
exchanged by the two machines successfully.
nslookup for the cluster name returns the IP of both A & B.
But still the machines don't recognize each other.
What could be the reason?
I managed to get the problem sorted out with help from Weblogic
support.
These machines have multiple network interfaces. I was told that
the IP, for which Weblogic license has been granted, should be
the first entry in the /etc/hosts file.
Besides, SP8 should be installed and configured correctly for the
communication to be established.
My original problem was that I was not able to see the "Adding
server" line when both the machines in the cluster were brought
up simultaneously. Both the machines would come up and would give
a message "Joined at 225.225.225.225" message and end the startup
process with "WebLogic Server started". The usual message acknowledging
the presence of the other machine is missing!
The cluster was not running when I ran the MulticastTest utility.
The curious thing was that MulticastTest ran successfully on both
the machines in the cluster and I could see the message packets
being exchanged correctly on the specific multicast IP that I was
using. But the machines in the cluster couldn't communicate with
each other!
Thanks for your responses!
Regards,
Mahesh Rajan
Prasad Peddada <[email protected]> wrote:
>If you see the message "Adding server ... " means that
>servers are in a
>cluster.
>
>You shouldn't run multicast test when servers are running.
>
>So, I don't understand what your problem is.
>
>-- Prasad
>
>Rajan wrote:
>
>> I have made this posting in In-Memory-replication group
>also.
>>
>> We are trying to setup a cluster with two machines A
>& B. These
>> are Solaris boxes with WLS 5.1 and SP8. The servers
>are multi-homed.
>>
>> When the two Weblogic servers are started concurrently,
>their logs
>> show that they joined at the designated multicast IP
>225.225.225.225.
>> But at the end of startup process they do not give the
>usual "Adding
>> server .....................to cluster view" message.
>>
>> I am able to ping each machine from the other.
>>
>> I have also run MulticastTest utility and the message
>packets are
>> exchanged by the two machines successfully.
>>
>> nslookup for the cluster name returns the IP of both
>A & B.
>>
>> But still the machines don't recognize each other.
>>
>> What could be the reason?
>
>--
>Cheers
>
>- Prasad
>
>
-
Connections not being released from jdbc pool on WLS 5.1 sp8
I am using WLS 5.1 on RedHat Linux kernel 2.4
The database is oracle 8.1.6 and I am using the thin jdbc driver as shown in the config below.
weblogic.jdbc.connectionPool.bobePool=\
url=jdbc:oracle:thin:@localhost:1521:<sid>,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=10,\
maxCapacity=22,\
capacityIncrement=5,\
allowShrinking=true,\
shrinkPeriodMins=3,\
testConnsOnReserve=true,\
testTable=dual,\
refreshTestMinutes=5,\
props=user=<username>;password=<password>
The problem I am facing is that some connections remain active
after the SQL query has finished. The no. of open connections
keep on piling up till the limit of 18 connections is reached and
ultimately at that point weblogic hangs.
Has someone else faced this problem...and found a solution??
Regards,
Anish Srivastava
System Analyst
Baazee.comHi Caren,
Weblogic doesn't close connections on "time-out". There are some reasons
for this. The most important one is that even if you have such a
functionality,
in case of a connection leak all the available connections can be trashed in
a matter of milliseconds, so it wouldn't help at all. Though, weblogic does
close leaked connection when they are garbage collected, but it's easy to
see
that it doesn't help a lot, too.
So you need to make sure that all the JDBC objects are closed properly,
for example like in this code:
try {
} finally {
try {resultSet.close();} catch (SQLException se) {}
try {preparedStatement.close();} catch (SQLException se) {}
try {connection.close();} catch (SQLException se) {}
Also it's possible that you simply don't have enough connection.
You could try to increase size of the pool.
Regards,
Slava Imeshev
"Karen Law" <[email protected]> wrote in message
news:[email protected]...
Closing the DB connections is important. But is there any parameters to be
set in the WebLogic configuration in order to release the connection whenit
hasn't been closed for a long time? Say, setting the connection timeout?
Many thx!
Karen
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
Do you close the DB connections in a finally block after you've finished
using them?
If not your application is leaking the connections and sometimes GC is
not able or does not free those in a timely manner.
--dejan
Anish Srivastava wrote:
I am using WLS 5.1 on RedHat Linux kernel 2.4
The database is oracle 8.1.6 and I am using the thin jdbc driver as
shown
in the config below.
weblogic.jdbc.connectionPool.bobePool=\
url=jdbc:oracle:thin:@localhost:1521:<sid>,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=1,\
initialCapacity=10,\
maxCapacity=22,\
capacityIncrement=5,\
allowShrinking=true,\
shrinkPeriodMins=3,\
testConnsOnReserve=true,\
testTable=dual,\
refreshTestMinutes=5,\
props=user=<username>;password=<password>
The problem I am facing is that some connections remain active
after the SQL query has finished. The no. of open connections
keep on piling up till the limit of 18 connections is reached and
ultimately at that point weblogic hangs.
Has someone else faced this problem...and found a solution??
Regards,
Anish Srivastava
System Analyst
Baazee.com -
Mildet connect to oracle DB using servlet problem ,help please
hi guys i have a problem am tring to connect my midlet to databse through midlet but i don`t know what is the problem so far the midlet already connect to my servlet url but the servlet cant read the parameters to open the connection for database
my servlet code
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.io.*;
import java.net.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.text.*;
* @author freddy
public class getconnection extends HttpServlet {
Statement statement;
ResultSet rs=null;
String bstr=null;
String bstr1=null;
String bstr2=null;
public void init()
* Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
/* TODO output your page here
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet getConnection</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet getConnection at " + request.getContextPath () + "</h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
doPost(request,response);
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
DataInputStream in = new DataInputStream(
(InputStream)request.getInputStream());
String sid = in.readUTF();
String user = in.readUTF();
String pwd = in.readUTF();
// "jdbc:oracle:thin:@localhost:1521"+": "+sid
String message = message = "Name:"+bstr+" telephone:"+bstr1+" burthday:"+bstr2;
try {
connect(sid,user, pwd);
message += "100 ok connected";
} catch (Throwable t) {
message += "200 " + t.toString();
response.setContentType("text/plain");
response.setContentLength(message.length());
PrintWriter out = response.getWriter();
out.println(message);
in.close();
out.close();
out.flush();
private void connect(String sid, String user,String pwd)
throws Exception {
// Establish a JDBC connection to the MYSQL database server.
//Class.forName("org.gjt.mm.mysql.Driver");
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:"+sid,user,pwd);
System.out.print("connected");
try{
statement =conn.createStatement();
rs=statement.executeQuery(" Select*from WOH.P_DEMGRAPHICS where P_ID='P1000 '");
catch(SQLException e)
System.err.print(e);
try{
while (rs.next()) {
bstr=rs.getString(2);
bstr1=rs.getString(3);
bstr2=rs.getString(4);
statement.close();
catch (SQLException e) {
//bstr += e.toString();
System.err.println(e);
System.exit(1);
// Establish a JDBC connection to the Oracle database server.
//DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
//Connection conn = DriverManager.getConnection(
// "jdbc:oracle:thin:@localhost:1521:"+db,user,pwd);
// Establish a JDBC connection to the SQL database server.
//Class.forName("net.sourceforge.jtds.jdbc.Driver");
//Connection conn = DriverManager.getConnection(
// "jdbc:jtds:sqlserver://localhost:1433/"+db,user,pwd);
* Returns a short description of the servlet.
public String getServletInfo() {
return "Short description";
// </editor-fold>
}Midlet code
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.io.*;
import java.util.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
* @author freddy
public class testOrcl extends MIDlet implements CommandListener {
protected String url;
private String username;
private Display display;
private Command exit = new Command("EXIT", Command.EXIT, 1);;
private Command connect = new Command("Connect", Command.SCREEN, 1);
private TextField tb;
private Form menu;
private TextField tb1;
private TextField tb2;
DB db;
public testOrcl() throws Exception
display=Display.getDisplay(this);
url="http://localhost:8084/getConnection/getconnection";
public void startApp() {
displayMenu();
public void displayMenu()
menu= new Form("connect");
tb = new TextField("Please input database: ","",30,
TextField.ANY );
tb1 = new TextField("Please input username: ","",30,
TextField.ANY);
tb2 = new TextField("Please input password: ","",30,
TextField.PASSWORD);
menu.append(tb);
menu.append(tb1);
menu.append(tb2);
menu.addCommand(exit);
menu.addCommand(connect);
menu.setCommandListener(this);
display.setCurrent(menu);
public void pauseApp() {
public void destroyApp(boolean unconditional) { }
public void commandAction(Command command, Displayable screen) {
if (command == exit) {
destroyApp(false);
notifyDestroyed();
} else if (command == connect) {
db = new DB(this);
db.start();
db.connectDb(tb.getString(),tb1.getString(),tb2.getString());
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.io.*;
import java.util.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.lang.*;
* @author freddy
public class DB implements Runnable {
testOrcl midlet;
private Display display;
String sid;
String user;
String pwd;
public DB( testOrcl midlet)
this.midlet=midlet;
display=Display.getDisplay(midlet);
public void start()
Thread t = new Thread(this);
t.start();
public void run()
StringBuffer sb = new StringBuffer();
try {
HttpConnection c = (HttpConnection) Connector.open(midlet.url);
c.setRequestProperty(
"User-Agent","Profile/MIDP-2.1, Configuration/CLDC-1.1");
c.setRequestProperty("Content-Language","en-US");
c.setRequestMethod(HttpConnection.POST);
DataOutputStream os =
(DataOutputStream)c.openDataOutputStream();
os.writeUTF(sid.trim());
os.writeUTF(user.trim());
os.writeUTF(pwd.trim());
os.flush();
os.close();
// Get the response from the servlet page.
DataInputStream is =(DataInputStream)c.openDataInputStream();
//is = c.openInputStream();
int ch;
sb = new StringBuffer();
while ((ch = is.read()) != -1) {
sb.append((char)ch);
showAlert(sb.toString());
is.close();
c.close();
} catch (Exception e) {
showAlert(e.getMessage());
/* This method takes input from user like db,user and pwd and pass
to servlet */
public void connectDb(String sid,String user,String pwd) {
this.sid = sid;
this.user = user;
this.pwd = pwd;
/* Display Error On screen*/
private void showAlert(String err) {
Alert a = new Alert("");
a.setString(err);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
Comment out process request or rewrite & move it to a position after you read the parameters and connect to the db. Decide where you want to write to the output stream. Also, you have some superfluous casting.
I take it that you are using netbeans? If you debug and step through the code you will get an idea of the flow. The steps should be, midlet connects with POST, doPost is called, server reads parameters, server opens connection, executes query, releases/closes connection, and writes a response to the midlet.
Some notes about the connect method; The scope of rs may cause problems. It is unlike you will have a valid result set if you have a problem with create statement or execute. Take a look at connection pooling and be mindful how the connections are opened, used, and closed; put all the important cleanup operations in a finally. Remove system.exit from your servlet. Actually I would suggest limiting the scope of all your vars;
If you store the username, password, and sid on the midlet, you may have trouble updating the installation base if you need to change the values for any reason. Also, you have clients which contain your database u/p, susceptible to snooping and decompilation. Use the servlet to abstract the db from the client. And use a datasource (with connection pooling) for obtaining connections to db. -
Servlet problem: (Shay Shmeltzer / Steve Muench / Frank Nimphius)
Dear sirs... (Shay Shmeltzer / Steve Muench / Frank Nimphius)
I hope you can give me an answer.
I created an ADF UIX application using JDeveloper 10.1.2. I have created a servlet to download files. my problem is that it works just fine using jdeveloper, while when deployed into oracle application server it causes errors.i am calling this servlet by storing filename and data in the session, then sending redirect request to the browser.
the servlet code is:
package view;
import java.io.OutputStream;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
public class FileDownload extends HttpServlet
public void init(ServletConfig config) throws ServletException
super.init(config);
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
try
String DownloadFileName=(String) request.getSession().getAttribute("downloadfilename");
byte data[]=(byte []) request.getSession().getAttribute("downloadfiledata");
if (DownloadFileName==null)
return;
request.getSession().removeAttribute("downloadfilename");
request.getSession().removeAttribute("downloadfiledata");
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename="+DownloadFileName);
response.setContentLength(data.length);
OutputStream OS=response.getOutputStream();
OS.write(data);
catch (Exception e)
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
try
String DownloadFileName=(String) request.getSession().getAttribute("downloadfilename");
byte data[]=(byte []) request.getSession().getAttribute("downloadfiledata");
if (DownloadFileName==null)
return;
request.getSession().removeAttribute("downloadfilename");
request.getSession().removeAttribute("downloadfiledata");
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename="+DownloadFileName);
response.setContentLength(data.length);
OutputStream OS=response.getOutputStream();
OS.write(data);
catch (Exception e)
and the error is :
java.lang.IllegalStateException: Response has already been committed
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1902)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:213)
this error is stored in the log file. if i am running this code from JDeveloper I can download the files using either FireFox or Internet Explorer without any error.
but if i am running this code using Oracle Application Server 10g Realse 2, i can not download the files using either FireFox or IE.
so i created another solution, instead of redirecting from a datapage into the servlet, i put the following code in a data page as follows:
public void onDownload(DataActionContext ctx)
String DownloadFileName=getfilename();
byte data[]=getdata();
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename="+DownloadFileName);
response.setContentLength(data.length);
OutputStream OS=response.getOutputStream();
OS.write(data);
OS.flash();
this time the application works fine when deployed into Oracle Application Server if you use FireFox, but if you use IE, it causes problem, i can not save the file or view it.
what is the problem?
how can i fix this?
i am certin that the second method is not correct and it should not be used.
thanks for everyone in advance
best regardsDear Sir...
Thanks alot for your replay
regarding the reset method. Itried it and it does not give any good.
I discovered the following problem:
If you are redirecting from with struts dataaction page to the servlet, you get the error
Otherwise if you called the servlet from directly or redirected to a servlet from within a servlet, you get no problem.
can any one help me please??
Is it possible that the problem is in IE itself? The file is downloaded perfectly fine with firefox(but the error log still appear)?
best regards -
Need urgent help on file download servlet problem in Internet Explore
I have trouble to make my download servlet work in Internet Explore. I have gone through all the previous postings and done some research on the internet, but still can't figure out the solution. <br>
I have a jsp page called "download.jsp" which contains a URL to download a file from the server, and I wrote a servlet (called DownloadServlet) to look up the corresponding file from the database based on the URL and write the file to the HTTP output to send it back to the browser. <br>
the URL in download.jsp is coded like <a href="/download/<%= currentDoc.doc_id %>/<%= currentDoc.name %>">on the browser, it will be sth like , the number 87 is my internal unique number for a file, and "myfile.doc" is the real document name. <br>
in my web.xml, "/download/" is mapped to DownloadServlet <br>
the downloadServlet.java looks like
tem_name = ... //read DB for file name
// set content type
if ( tmp_name.endsWith(".doc")) {
response.setContentType("application/msword");
else if ( tmp_name.endsWith(".pdf")){
response.setContentType("application/pdf");
else if ( tmp_name.endsWith(".ppt")){
response.setContentType("application/vnd.ms-powerpoint");
else if ( tmp_name.endsWith(".xls")){
response.setContentType("application/vnd.ms-excel");
else {
response.setContentType("application/download");
// set HTTP header
response.setHeader("Content-Disposition",
"attachment; filename=\""+tmp_name+"\"");
OutputStream os = response.getOutputStream();
//read local file and write back to browser
int i;
while ((i = is.read()) != -1) {
os.write (i);
os.flush();
Everything works fine in Netscape 7.0, when I click on the link, Netscape prompts me to choose "open using Word" or "save this file to disk". That's exactly the behavior I want. <br>
However in IE 5.50, the behavior is VERY STRANGE.
First, when I click on the URL, the popup window asks me to "open the file from its current location" or "save the file to disk". It also says "You have chosen to download a file from this location, ...(some url).. from localhost"
(1) If I choose "save the file to disk", it will save the rendered "download.jsp" (ie, the currect page with URL I just clicked, which isn't what I want).
(2)But if I choose "open the file from its current location", the 2nd popup window replaces the 1st, which also has the "Open ..." and "Save.." options, but it says "You have chosen to download a file from this location, MYFILE.doc from localhost". (notice it shows the correct file name now)
(3) If I choose "Save..." on the 2nd window, IE will save the correct file which is "myfile.doc"; if I choose "Open ...", a 3rd replaces the 2nd window, and they look the same, and when I choose "Open..." on the 3rd window, IE will use Word to open it.
any ideas?
</a>Did you find a solution to this problem? I've been wrestling with the same issues for the past six months. Nothing I try seems to work. I've tried setting the contentLength(), inline vs. attachments, different write algorythms, etc. I don't get the suggestion to rename the servlet to a pdf file.
-
Servlets - problem with session
Hi there ppl,
I have a login servlet which is called form a link in a static html page. The doGet() method is as below:
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, java.io.IOException
HttpSession session = public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, java.io.IOException
HttpSession session = request.getSession(false);
RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
response.setContentType("text/html");
//PrintWriter out = response.getWriter();
if(session != null){
//display members page(with users name as a welcome)
System.out.println("in login servletb");
else{
System.out.println("in login servlet");
request.setAttribute("membersName", "adom");
rd.forward(request, response);
//out.close();
RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
if(session != null){
//display members page(with users name as a welcome)
System.out.println("session exists");
else{
System.out.println("session not exisit");
request.setAttribute("membersName", "adom");
rd.forward(request, response);
Problem is when i click on the link in the html page it goes into tthe else statement and displays the login.jsp page fine. But when i click bak on the browser and then click the link agian it goes into the if statemtn..as if a session exists. But why does a session exisit???...if i use request.getSession(false) this shouldnt create a session if one doent already exists so where is this mysterious session being created??
any ideas would be greatly appreaciated
Mycallyer i do need the session because in my doPost() method of the servlet i create a session once the user logs on with there login/pass. The doGet() method is only to direct the person to the login page. But i want to check for the session in the doGet() incase they have already login in...if so direct them to the main page rather than to the login page agian.
I stuffed up the code in my previous post...everything compiles and works fine apart from the fact that a session is created when it shouldnt be. I did a test println with session.getCreationTime() and it was created the same time the servlet was initial called. However im not sure if it was created by my servlet or if the broswer somehow had something to do with it....hmm is a worry.
Heres the code again...hopefully a bit neater for u :D
public void doGet(HttpServletRequest request, HttpServletResponse reponse)throws ServletException, java.io.IOException{
HttpSession session = request.getSession(false);
RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
if(session != null){
//display members page(with users name as a welcome)
System.out.println("session exists");
else{
System.out.println("no session");
request.setAttribute("membersName", "adom");
rd.forward(request, response);
thanks agian :) -
J_security_check servlet problems
Hi, we use forms based authentication in our web app and I've come across some bizarre behavior in j_security_check.
The problem is as follows: if a user goes to a form that is within our web application and sits on that form until their session times out, then decides to submit that form (triggering an HTTP POST), then iPlanet correctly displays the forms based login page. The problem hoewver is that after the user puts in their credentials and authenticates, iPlanet's j_security_check forgets where it was (the form page, call it foo.jsp for now) and it forgets where the data was being submitted to (we'll call it submitfoo.jsp for now). Furthermore the data is lost. What j_security_check ends up doing is somehow redirecting to the root of the web application, which in our case ends up displaying the stupid directory listing of our web app. We dont' have an index.html or index.jsp in our web app root and suppressing directory listings in iPlanet is not trivial (if someone knows how to do this reliably, apart from creating an index.html in all the directories i want suppressed, please let me know).
Soooo, does iPlanet consider this a bug with the j_security_check servlet used for form based authentication or is this a "feature" they offer? how can i as a developer get j_security_check to forward to a page other than what it decides?
Thanks,
RyanHi, we use forms based authentication in our web app and I've come across some bizarre behavior in j_security_check.
The problem is as follows: if a user goes to a form that is within our web application and sits on that form until their session times out, then decides to submit that form (triggering an HTTP POST), then iPlanet correctly displays the forms based login page. The problem hoewver is that after the user puts in their credentials and authenticates, iPlanet's j_security_check forgets where it was (the form page, call it foo.jsp for now) and it forgets where the data was being submitted to (we'll call it submitfoo.jsp for now). Furthermore the data is lost. What j_security_check ends up doing is somehow redirecting to the root of the web application, which in our case ends up displaying the stupid directory listing of our web app. We dont' have an index.html or index.jsp in our web app root and suppressing directory listings in iPlanet is not trivial (if someone knows how to do this reliably, apart from creating an index.html in all the directories i want suppressed, please let me know).
Soooo, does iPlanet consider this a bug with the j_security_check servlet used for form based authentication or is this a "feature" they offer? how can i as a developer get j_security_check to forward to a page other than what it decides?
Thanks,
Ryan
Maybe you are looking for
-
Settlement of WBS element down payments to an asset under constructions
The down payment (of the transactions tcode F-47 and tcode F-110), are always settlement wbs element (tcode CJ88), we do not want to post down payments to the receiving asset under construction (transaction type 180 or 181). In the down payments are
-
Web cam is not recognized properly on Satellite L500D
Hi I have a Satellite L500D when I login in the web cam app pops up and say web camera initialization failed. Please check your camera device and restart application or computer. I press ok and the app closes down so I checked the device manager and
-
Unable to reset 3rd gen Apple TV via iTunes
3rd Gen Apple TV started flashing. Screen is completely black, so plugged in to computer at present as Apple suggests, but there is nothing on iTunes as shown to allow me to reset the Apple TV. Any suggestions?
-
My mid-2007 iMac does not have a working wi-fi setting. Network connections do not work, and wi- fi does not discover router. Only works on Ethernet. Do others have this problem? Thanks
-
ExportPDF won't convert my PDF
"export wegen Sicherheitseinstellungen nicht möglich" was muss ich wo ändern?