JWS weird Authentication deadlock on HttpUrlConnection with response 401

Right after writing it all down (offline), I found the *bug here* just before posting.
I'll post it anyway as it was, 'cause it costed me time and this won't be wasted if it comes usefull for someone else.
The only pending questions are: does anybody know a workaround for the bug? And why does this only happen when having a dedicated thread and not running in EventDispatcher?
Do you think posting in Swing forum may be usefull to get a solution with connection running in EventDispatcher and another thread listening for button pressure?
And, now, here it is what I wrote at first:
I have a simple SwingWorker testing credentials on a SSO connection (I've tried with my own Thread code also), everything works fine on standard jre (with standard java.net implementation), but on JWS I'm getting this weird lock:
"SwingWorker-pool-1-thread-3" prio=6 tid=0x031f1400 nid=0x130 in Object.wait() [0x0344f000..0x0344fc94]
   java.lang.Thread.State: WAITING (on object monitor)
     at java.lang.Object.wait(Native Method)
     - waiting on <0x23169bc0> (a java.util.HashMap)
     at java.lang.Object.wait(Object.java:485)
     at sun.net.www.protocol.http.AuthenticationInfo.requestIsInProgress(Unknown Source)
     - locked <0x23169bc0> (a java.util.HashMap)
     at sun.net.www.protocol.http.AuthenticationInfo.getServerAuth(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
     - locked <0x22a0e668> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
     at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(Unknown Source)
     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(Unknown Source)
     at my class reading header for cookies to setI also get stack if I try reading response code (requestIsInProgress should be meaningfull about this).
Everything goes fine until request successeds, I have problems when server returns 401, first test ends correctly: I throw an exception telling me 'login failed, wrong username or password, check credentials' and this gets written in my result area.
But something gets locked in the Authentication infrastructure, than on, if I test again with wrong credentials it freezes waiting, If I test with right credential everything is fine ('cause it doesn't ask for Auth).
I've got my own Authenticator because on my SSO server I must return null (jws doesn't manage correctly SSO auth), but I wanna keep asking for proxy credentials, I though it could be it and went back to default one (and to null one), nothing changed (except annoying, not working, authentication mask).
Everything works fine if I use a single thread solution, but this means everything gets done in EventDispatcher and can't be stopped, I don't want it like this.
I've notice this other thing: if I call notifyAll at the and of done() method it goes fine on standard JRE, but I get IllegalMonitorState in JWS.
There's just one instance running, anyhow the connection code itself is multithread tested (I've run thousands at same time to test server-load).
Connection goes like this (everything in HTTPS):
- ask for homepage: it is under SSO, so i get a MOVED and destination url contains an SSO token
- read destination url and go there adding username and password (I'm using GET, final version will use POST for security reasons): i get a MOVED to login success page and go there to 'activate' SSO session and get my cookie OR (wrong credentials) I get 401, that is my problem. I can even get MOVED to other url (having account locked or other SSO error), this has no impact on my problem, just reporting to assure you problem is just as described.
Obviously homepage request goes always fine, you just get stack on second part when getting 401 for second time, 'cause first one left a resource locked.
Any suggestions?
Here is SwingWorker code (test is a button, connection is a pointer to SwingWorker I keep to know if it's running, risultato is a textarea where I write the test result, BaseMessages retrieves i18n messages):
     test.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent e) {
          if (connection!=null&&!connection.isDone()){
              connection.cancel(true);connection=null;return;
           connection = new SwingWorker<String, Object>(){
              protected String doInBackground() throws Exception {
               //my method creating SSO connection (it then invokes a servlet that just mirrors username to prove authentication)
               return new ClientUpload(getUsername(), getPassword()).testConnection();
              protected void done() {
                  super.done();
                  try {
                   risultato.setText(get());
               } catch (InterruptedException e) {
                   risultato.setText(BaseMessages.getMessage("test.cancelled"));
               } catch (CancellationException e) {
                   risultato.setText(BaseMessages.getMessage("test.cancelled"));
               } catch (ExecutionException e) {
                   e.printStackTrace();
                   risultato.setText(BaseMessages.getMessage("test.error")+ e.getMessage());
               risultato.repaint();
               test.setText(BaseMessages.getMessage("test"));
               test.setIcon(testIcon);
               setCursor(Cursor.getDefaultCursor());
               connection=null;
               //notifyAll();
          setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
          risultato.setText(BaseMessages.getMessage("connecting"));
          test.setText(BaseMessages.getMessage("test.cancel"));
          test.setIcon(stopIcon);
          connection.execute();
     });What's wrong? Why doesn't single thread solution produce deadlock the same? Which object does jws java.net implementation lock (I tried calling notifyAll on everything)? Anyone having sun.net.www.protocol.http source code?
Please help, I'm really java disappointed at this time (first big 'Write once, run only where written!' of my programmer life).
P.S.: I tried both with and without Keep-Alive. And tried moving super.done() at the end of method.

I got it! It works for most cases (it works for mine for sure, doesn't work if you're talking with many servers, I suppose), may be refined (for multi-thread, multi-server, etc..). After getting response code 401 (in the connection code I did not post) I just call:
try {
    Field f= Class.forName("sun.net.www.protocol.http.AuthenticationInfo").getDeclaredField("requests");
    f.setAccessible(true);
    HashMap hm=(HashMap)f.get(null);
    hm.clear();
} catch (Exception e) {
    e.printStackTrace();
}I really love reflection.
I also tried invoking notifyAll an AuthenticationInfo, requests and objects in it, but nothing worked (except submitted code).
I'll leave a Duke on it (were seven, sorry), may be someone has better ideas.

Similar Messages

  • Authentication and Authorization Problems with IIS 6 and Jrun 4

    Hello all,
    I am using IIS 6 with JRun 4 as my app server, and I am having problems trying to get authentication and role authorization with Windows Integrated Authentication to work. I have set up IIS 6 to pass-through the authentication credentials to Jrun, without using an anonymous user. What I have done is written a small test servlet that displays the username of the logged in user, and then tries to check if a user is in a test role that I set up in my database. I have specified that a roles table is to be used by specifying a JDBCLoginModule in Jrun's auth.config file. The code for the servlet is below:
    package testauthenticationapp;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class SecureTestServlet extends HttpServlet {
       private static final String CONTENT_TYPE =
          "text/html; charset=windows-1252";
       public void init(ServletConfig config) throws ServletException {
          super.init(config);
       public void doGet(HttpServletRequest request,
                         HttpServletResponse response) throws ServletException,
                                                              IOException {
          response.setContentType(CONTENT_TYPE);
          PrintWriter out = response.getWriter();
          out.println("<h3>REMOTE USER: " + request.getRemoteUser() + "</h3>");
          if (request.getUserPrincipal() != null){
             out.println("<h3>" +request.getUserPrincipal().getName() + "</h3>");
          } else{
             out.println("<h3>User Principal is null</h3>");
          if (request.isUserInRole("Test_Role")){
             out.println("<h3>User is in Test_Role</h3>");
          } else {
             out.println("<h3>User is NOT in Test_Role</h3>");
          out.close();
    1.  What I am seeing is that when request.getRemoteUser() is called, the username information is what I expect it to be. It is of the form <Domain>\<Username>. When I try to redisplay the username using the request object's Principal object, the call to request.getUserPrincipal() returns null. This is a little confusing to me since I thought that essentially getRemoteUser() was a short cut for calling getUserPrincipal().getName(), and if I get something for getRemoteUser, getUserPrinicipal should return something as well. I guess they work differently at some level. Has anyone ever encountered this before?
    2. When I call request.isUserInRole("Test_Role"), it returns false. I've checked the role name being called for typos in both my database and in the code, and that does not seem to be the case. I think the setup in auth.config is properly configured because I have created many other applications using declaritive FORM based authentication, and the role information was retrieved fine from the database. I would think that when I use request.isUserInRole in my servlet code it would use the same role information, but I could be wrong since this is a different type of authentication. Do you think that the reason request.isUserInRole() is returning  false could be tied to the fact that request.getUserPrincipal() is returning null (even though getRemoteUser() is returning a valid username)? How does request.isUserInRole() get its user information, by using getUserPrincipal().getName() or getRemoteUser()?
    Any help that is provided is appreciated. Thanks in advance.

    Try This...
    Close All Open Apps...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • Authentication error in weblogic portal 10.2 (Response: '401: Unauthorized'

    I have written following code in my page flow controller in order to access file from a shared location:
    Authenticator.setDefault(new MyAuthenticator(username, password));
    URLConnection conn = new URL(urlString).openConnection();
    InputStream instr = conn.getInputStream();
    BufferedReader in = new BufferedReader(new InputStreamReader(instr));
    String str;
    while ((str = in.readLine()) != null) {
         System.out.println(str);
    It always gives me folloing error:
    java.io.FileNotFoundException: Response: '401: Unauthorized' for url: 'http://coldev01.col.us.bic/testspec/library/Approved/Packaging%20Components/5647495.pdf'
         at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:476)
         at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:36)
    If I directly past this url in browser then this pdf opens properly but when i try to do through code then it does not work. Any quick help would be highly appreciated.
    MyAuthenticator class
    private static class MyAuthenticator extends Authenticator {
         private String username, password;
         public MyAuthenticator(String user, String pass) {
         username = user;
         password = pass;
         protected PasswordAuthentication getPasswordAuthentication() {
         System.out.println("Requesting Host : " + getRequestingHost());
         System.out.println("Requesting Port : " + getRequestingPort());
         System.out.println("Requesting Prompt : " + getRequestingPrompt());
         System.out.println("Requesting Protocol: "
         + getRequestingProtocol());
         System.out.println("Requesting Scheme : " + getRequestingScheme());
         System.out.println("Requesting Site : " + getRequestingSite());
         return new PasswordAuthentication(username, password.toCharArray());
    Thanks,
    Alka

    Use something like HTTPClient (instead of URLConnection) which will let you specify Username/password for basic auth
    e.g. http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/examples/BasicAuthenticationExample.java?view=markup
    Edited by: deepshet on May 4, 2010 9:46 AM

  • Strange behaviour with response.sendRedirect

    I have a strange problem with response.sendRedirect
    --The following is part of a class that implements Filter (its main task is to check for authentication)
    The redirect method hresponse.sendRedirect doesnot work (so i had to make it a forward method using dispatcher)
    The second one however, works!!!! how could that be?
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          throws ServletException, IOException
               HttpServletRequest h =(HttpServletRequest)request;
               HttpServletResponse hresponse = (HttpServletResponse)response;
               ServletContext application = config.getServletContext();
            Connection con = (Connection)application.getAttribute("connection");
               String username = (String)h.getSession().getAttribute("user");
               String credentials = (String)h.getSession().getAttribute("cred");
               PrintWriter out = response.getWriter();
               if (con != null)
                   try
                   Statement     stmt = con.createStatement(
                        ResultSet.TYPE_SCROLL_INSENSITIVE,
                         ResultSet.CONCUR_READ_ONLY);
              ResultSet rs;
                        rs = stmt.executeQuery("SELECT * FROM member WHERE username = '"+ username
                                                                                              +"' AND password ='" + credentials+ "' ");
                        if(rs.next() && rs != null)
         String path = h.getServletPath() ;
              h.getSession().setAttribute("user", username);
              h.getSession().setAttribute("cred", credentials);
              //RequestDispatcher dispatcher = config.getServletContext().getRequestDispatcher(path);
    //dispatcher.forward(request,response);
              String s = hresponse.encodeURL("http://localhost:8080/support/mtext.html");
                   //out.println(s);
                   hresponse.sendRedirect(s);
                        else
         String path = h.getRequestURI();
         String query = h.getQueryString();
    //     String query_sub = query.substring(0,equalPos);
         if (!query_sub.equals("threadID"))
              out.println("error occured");
                   else
              if(query == "null")
                   query="";
              else
                   query= "?" + query;
                   hresponse.sendRedirect(hostPath + "/support/index2.jsp?"+
                   "forward="+h.getRequestURI() + query );
                   }

    Hi,
    response.sendRedirect() may throw an IOException if URL not found.So you have to write throws or try & catch.
    Ajay.

  • Weird behaviour in OpenGL compositing with r300g

    Hello,
    I have a weird issue on my laptop with both KDE 4.6.5 and 4.7RC2. When switching on desktop effects with Alt-shift-F12, the screen turns gray, with a darker gray for the panel. I can also see the decorations ok, but that's all. The weirdest thing is that Kwin doesnt complain about anything, and everything comes back to normal when I switch off desktop effects.
    The only warning message i get is from dmesg: "composite sync not supported". I didnt find any similar description on forums or bug reports. The issue happens with Arch's KDE 4.6.5 to 4.7RC2 and Chakra 4.6.4 to 4.7RC2. It doesnt happen with Kubuntu 's KDE 4.6.2 (didnt try with later versions but its unlikely minor versions would change smthg right?)
    graphic chipset is ATI Radeon Xpress200M (driver radeon r300g)
    glxinfo reports :
       OpenGL renderer string: Gallium 0.4  on ATI RS482
       OpenGL 2.1 Mesa 7.10.3 (same happens with 7.11 rc1)
    Other info:
    The issue doesnt happen with Xrender backend
    The issue still happens with any arrangement of options in the desktop effect advanced configuration (with/without Vsync, w/wo direct rendering...)
    No (WW) neither (EE) in Xorg log, all extensions load fine (Composite, Dri, Dri2, glx ...)
    kms enabled
    Arch linux installed on usb disk, working perfectly fine when running on another workstation with intel graphics.
    Doesn anyone have a clue what is going on? Is there something I am missing here?

    Below format: works perfectly fine
    Fiscal Date BETWEEN '@{PV_ST_DT}{01/01/2007}' AND '@{PV_END_DT}{01/03/2007}'

  • Is anyone else having a weird bug in MobileMe gallery with volume on iOS 5

    Is anyone else having a weird bug in MobileMe gallery with volume on iOS 5? I am having a weird problem, where if I view a video I have uploaded and change the volume, I used the on-screen slider and It changed the volume but it also popped up like I was controlling it from the side. I thought that was kind of weird. If you want to see my problem, there will be a video up on Contemputech.com within a half-hour of me writing this.
    Thanks!
    Nolan

    Hello everyone!
    I'm hoping you are no longer having problems with your iPhone visual voice mail.
    I can understand how frustrating it is to not be able to access such a great feature on your iPhone.
    We did determine  customers not being able  to access Visual Voicemail on their iPhones.
    Common errors are "visual voicemail is not available" or it just keeps loading the message. 
    (In the meantime, you can still review voicemail messages by dialing *86)
    This issue should have been resolved for everyone effective 3/2/12.
    Please let me know if you are still having problems with iPhone Visual Voicemail by sending me a direct message.
    Thanks for your patience with this.
    Tamara H.
    Follow us on Twitter @VZWSupport

  • There is a problem with this connection's security certificate The remote computer cannot be authenticated due to problems with its security certificate. Security certificate problems might indicate an attempt to fool you or intercept any data you send

    Hi,
    I have this Windows 2008 R2 on which I installed remoteapp some years ago.
    Now the certificate expired and I get the message
    "There is a problem with this connection's security certificate
    The remote computer cannot be authenticated due to problems with its security certificate.
    Security certificate problems might indicate an attempt to fool you or intercept any data you send to the remote computer."
    How should I renew the certificate? I already went to certification store and tried to renew certificate with same key but then it says "the request contains nor certificate template information".
    Please advise.
    J.
    J.
    Jan Hoedt

    Does the computer account have Enroll permission to the certificate template?
    From the Server running your CA, run mmc, click File then Add/Remove Snap-in...
    Add Certificate Templates and click OK.
    Find the certificate template, then right click and select properties.  On my CA its call ed RemoteDesktopComputers but might be called something different depending on what what template your certificate is based on.
    On the security tab, click Oblect types, check Computers then OK. Enter the Computername and click OK.  Then give your computer account Enroll permisssion.
    HTH,
    JB

  • Getting java.lang.IllegalStateException error with response.getOutputStream

    Hi,
    I am writer a JSP site for displaying JFreeChart. The main JSP page gets some parameters then the second page out put the chart as binary data with a Java class.
    I've located the part which generated the error, as follows:
    Code:
    OutputStream os = response.getOutputStream(); <--- this line cause the error
    response.setContentType("image/png");
    ChartUtilities.writeChartAsPNG(os, chart, 400, 300);
    (other than it, the JSP does nothing with response or out)
    Error:
    Servlet.service().for servlet jsp threw exception java.lang.IllegalStateException
    at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
    at org.apache.jsp.build005f005.seriesChart_jsp.jspService(org.apache.jsp.build_005f005.seriesChart_jsp:110)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWarpper.java:325)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    I've searched this forum and google and seeking for solution for thousands times. But sadly, ways such as adding out.reset(); doesn't work.
    Would any one has some suggestion for me? Your help is very appreciated. Thanks!

    A similar question / answers from jGuru.com
    Question I used getOutputStream() of response object in JSP. Below is the code for download a file in JSP.
    %>
    <%@ page import="java.util.*,
                        java.io.*"
    %>
    <%@ page language="java"
              session="false"
              contentType="text/html; charset=8859_1"
    %>
    <%
         //read the file name.
         File fFile = new File ("D:/Ibs/outdir/batchres.conf");
         String stFileName = "batchres.conf";
         //the content type set as excel
         response.setContentType ("application/excel");
         //the header and also the Nameis set by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;filename=\""+stFileName+"\"");
         //Open an input stream to the file and post the file contents thru the
         //servlet output stream to the client m/c
         InputStream isStream = null;
         ServletOutputStream sosStream = null;
         try
              //response.flushBuffer();
              isStream = new FileInputStream(fFile);
              sosStream = response.getOutputStream();
              int ibit = 256;
              while ((ibit) >= 0)
              ibit = isStream.read();
              sosStream.write(ibit);
         catch (IOException ioeException)
    sosStream.flush();
    sosStream.close();
    isStream.close();
    %>
    If run this code in Tomcat i am getting following error.. �<h1>Error: 500</h1> <h2>Location: /imu/jsp/ibUTLCmnDownloadView.jsp</h2>Internal Servlet Error:
    java.lang.IllegalStateException: getOutputStream() has already been called
         at org.apache.tomcat.facade.HttpServletResponseFacade.getWriter(Unknown Source)
         at org.apache.jasper.runtime.JspWriterImpl.initOut(Unknown Source)
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(Unknown Source)
         at jsp.ibUTLCmnDownloadView_12._jspService(ibUTLCmnDownloadView_12.java, Compiled Code)
         at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
         at org.apache.tomcat.core.Handler.service(Unknown Source)
         at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
         at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(Unknown Source)
         at org.apache.tomcat.facade.RequestDispatcherImpl.forward(Unknown Source)
         at JP.co.Hitachi.soft.IBS.Common.Servlet.ibUTLCmnDownloadScrGenServlet.doPost(ibUTLCmnDownloadScrGenServlet.java:75)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
         at org.apache.tomcat.core.Handler.service(Unknown Source)
         at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
         at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
         at org.apache.tomcat.core.ContextManager.service(Unknown Source)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)
    Answer
    Don't know if this will help--your code worked as is on my system (J2SDK 1.4.1, Tomcat 4.1.12, Linux)--but you're setting the content-type twice, and to two different values. In the page directive, you specify contentType="text/html; charset=8859_1", and then in the scriptlet, you do a response.setContentType ("application/excel");. Try changing the one in the page directive and deleting the one in the scriptlet. The servlet container may be calling getOutputStream() when it sees the text MIME type so it can prepare the out built-in variable.
    Also, according to the J2EE design patterns, JSP's should only be used to produce text output. Any binary output (such as Excel files) should be produced with servlets--otherwise, the JSP becomes one big scriptlet (like this one).
    If you still want to do this with a JSP, you might want to take out your try ... catch block since you're not doing anything with it. Doing so will allow you to let the servlet container handle the errors (i.e. specify error pages in the web application deployment descriptor). Either that, or at least put the close() and flush()calls in it since they can throw IOExceptions, too. :)
    Finally, you should never close the servlet's output stream. Leave that up to the servlet container.
    Is this item helpful? yes no Previous votes Yes: 2 No: 3
    To transfer file from client to server using jsp programs
    chalpati Rao, Aug 11, 2004 [replies:1]
    How to Download File using JSP program
    Re: To transfer file from client to server using jsp programs
    Saravanan Mani, Aug 24, 2004
    Try restarting the server.It worked for me (ie.you did all the code changes mentioned in the previous reply)
    Breakline problems
    David Machado, Jan 27, 2005 [replies:1]
    Hi! Maybe a problem with breaklines. Try this: ------------------------------------------------------
    %><%@ // don't send breakline here!!!
    page import="java.util.*,
    java.io.*"
    %><%@ // don't send breakline here too!!!
    page language="java"
    session="false"
    contentType="text/html; charset=8859_1"
    %><% // finally, don't send breakline here!!!
    //read the file name.
    File fFile = new File ("D:/Ibs/outdir/batchres.conf");
    String stFileName = "batchres.conf";
    //the content type set as excel
    response.setContentType ("application/excel"); // twice???
    //the header and also the Nameis set by which user will be prompted to save
    response.setHeader ("Content-Disposition", "attachment;filename=\""+stFileName+"\"");
    //Open an input stream to the file and post the file contents thru the
    //servlet output stream to the client m/c
    InputStream isStream = null;
    ServletOutputStream sosStream = null;
    try
    //response.flushBuffer();
    isStream = new FileInputStream(fFile);
    sosStream = response.getOutputStream();
    int ibit = 256;
    while ((ibit) >= 0)
    ibit = isStream.read();
    sosStream.write(ibit);
    catch (IOException ioeException)
    sosStream.flush();
    sosStream.close();
    isStream.close();
    %> // make sure that's no breakline an no spaces at the end!!
    Re: Breakline problems
    Aarthi Sivaram, Apr 19, 2005
    In the above code sosStream = response.getOutputStream(); must be removed. Use 'out' instead of sosStream i.e. out.write(""+ibit); If you look at the Java code generated for your JSP, you can find JspWriter out = null ... .. JspWriter calls response.getOutputStream(), thats why when u call getOutputStream, u get IllegalStateException. 'out' variable is available for direct use in all JSP's, like 'request'. So that can be directly used to write.
    A quick and working workaround
    Leslie Leng, May 20, 2005 [replies:1]
    I am not going to discuss the theory behind, as others gurus mentioned before me, are valid.
    In short, getOutputStream() could not be used more than once, and also it will conflict with JSPWriter's out.
    So, the quick workaround would be, at the end of the JSP page, add the following:
    out.clear();
    out = pageContext.pushBody();
    in example:
    catch(Exception e){
    System.out.print(e);
    out.clear();
    out = pageContext.pushBody();
    %>
    Re: A quick and working workaround
    ajit Pandey, Jul 15, 2005
    Thanks a ton Leslie ,it worked(Production issue) :) credit goes to you....indebted

  • Looking for img rotator with responsive design

    does any one know code for html for img rotator with responsive design

    Copy & paste this code into a new, blank document in DW.  SaveAs test.html  Preview in Firefox or Chrome.  IE is rubbish.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Cycle2</title>
    <!--helpf for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--Latest jQuery Core Library-->
    <script src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    <!--Cycle2 Slideshow Plugin-->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>
    <style>
    /**Slideshow**/
    .cycle-slideshow {
        position: relative;
        z-index: 1;
        width: 50%; /**adjust width as required**/
        margin:75px auto;
        text-align: center;
    .cycle-slideshow img { max-width: 100% }
    /* prev / next links */
    .cycle-prev, .cycle-next {
        position: absolute;
        top: 0;
        width: 20%;
        opacity: 0;
        filter: alpha(opacity=0);
        z-index: 800;
        height: 100%;
        cursor: pointer;
    .cycle-prev {
        left: 0;
        background: url(http://malsup.github.com/images/left.png) 50% 50% no-repeat;
    .cycle-next {
        right: 0;
        background: url(http://malsup.github.com/images/right.png) 50% 50% no-repeat;
    .cycle-prev:hover, .cycle-next:hover {
        opacity: .7;
        filter: alpha(opacity=70)
    /**END SLIDESHOW STYLES**/
    </style>
    </head>
    <body>
    <h1><a href="http://jquery.malsup.com/cycle2/">JQuery Cycle2</a></h1>
    <!--begin slideshow-->
    <div class="cycle-slideshow"
        data-cycle-fx="scrollHorz"
        data-cycle-pause-on-hover="true"
        data-cycle-speed="600"
        >
    <!-- prev/next links -->
    <div class="cycle-prev"></div>
    <div class="cycle-next"></div>
    <!--insert your images below-->
    <img src="http://jquery.malsup.com/cycle2/images/p1.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p2.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p3.jpg" alt="description">
    <img src="http://jquery.malsup.com/cycle2/images/p4.jpg" alt="description">
    <p>Mouse over image for previous / next links</p>
    </div>
    <!--end slideshow-->
    </body>
    </html>
    Nancy O.

  • How come the sight was down so long? and why does the system not send emails anymore with responses?

    how come the sight was down so long? and why does the system not send emails anymore with responses?

    The system is back up and fully functional. How long has it been since you stopped receiving notifications? Can you share your form with us so we can have a look into what might be going wrong?
    Andrew

  • SUBSCRIBE and INVITE events with Asterisk 401 and 489 response.

    Hello group, wondering if I could get your input on something quickly. We are using Asterisk with our SPA525 and SPA514 phones and looking through the capture logs it looks like Asterisk doesn't support the INVITE and SUBSCRIBE events. It typically comes back with a 401 Unauthorized or 489 Bad Event message. If Asterisk doesn't support these features can we prevent the phones from sending them? Your feedback is appreciated.

    Ok, got some more data on this issue:
    It hung again this afternoon.  Would not ping, could not use the web interface, it just hosed.  Syslog was running and the SPA112 spit out these two lines before it jumped off the cliff:
    Wed Oct 24 15:47:16 2012 10.10.1.10 <29>Oct 24 15:47:16 SPA112 msgswitchd[1385]:   MSGSWD RTCP Reqt len 12 Data 2,1092717788,2629110,0
    Wed Oct 24 15:47:16 2012 10.10.1.10 <29>Oct 24 15:47:16 SPA112 msgswitchd[1385]:   MSGSWD RTCP Reqt len 12 Data 2,2874904,7312,0
    Those were its last words, so to speak.  The asterisk logs were not helpful, just normal activity right up to where it was unreachable.  Problem is I can't reboot this remotely when it gets in this condition.  It requires a manual power cycle - this is not workable.
    Cisco, you've been quiet - can you help here?

  • OracleBamAdapter: "Bad response: 401 Unauthorized"

    Hi
    I'm trying to connect BPM to BAM over the OracleBamAdapter. I set properties of the outgoing connection "eis/bam/soap" to server "localhost" and port "29001" (on which BAM Server is running) plus userName and password. The user works well with iCommand. When I run the bpmn process below-mentioned failure occurs.
    If found out when I connect to the wsdl (http://vweb01:29001/OracleBAMWS/WebServices/ManualRuleFire?WSDL) a http-user and a http-password is requiered. So I guess that this is the reasion for mentioned failure.
    What does I have to change the Adapter does the http authentication?
    Thx a lot for help.
    Pascal
    <Sep 28, 2010 4:55:51 PM CEST> <Warning> <oracle.bpm.analytics.bam> <BEA-000000> <failed on bamDataObjectCache.getBAMDataObjectBean(). Unable to find /Demos/Bookstore/COUNTER>
    <Sep 28, 2010 4:55:51 PM CEST> <Warning> <oracle.bpm.analytics.bam> <BEA-000000> <Exception
    javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 401 Unauthorized
    at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:784)
    at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:234)
    at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:105)
    at com.collaxa.cube.engine.sensor.sa.publisher.bamMonitor.icommand.ICommandDispatch.batch(ICommandDispatch.java:78)
    at com.collaxa.cube.engine.sensor.sa.publisher.bamMonitor.cache.BAMDataObjectCache.lookupDataObject(BAMDataObjectCache.java:100)
    at com.collaxa.cube.engine.sensor.sa.publisher.bamMonitor.cache.BAMDataObjectCache.getBAMDataObjectBean(BAMDataObjectCache.java:244)
    at com.collaxa.cube.engine.sensor.sa.publisher.bamMonitor.cache.BAMDataObjectCache.addCacheEntry(BAMDataObjectCache.java:222)
    at com.collaxa.cube.engine.sensor.sa.publisher.bamMonitor.cache.BAMDataObjectCache.getDataObjectBean(BAMDataObjectCache.java:204)
    at oracle.bpm.analytics.bam.connector.BindingOperationFactory.getBAMDataObjectBean(BindingOperationFactory.java:326)
    at oracle.bpm.analytics.bam.connector.BindingOperationFactory.createBindingOperationParams(BindingOperationFactory.java:168)
    at oracle.bpm.analytics.bam.connector.BAMConnector.processCOUNTER(BAMConnector.java:281)
    at oracle.bpm.analytics.bam.connector.BAMConnector.processCOUNTER(BAMConnector.java:259)
    at oracle.bpm.analytics.bam.connector.BAMConnector.handleAuditInstance(BAMConnector.java:155)
    at oracle.bpm.analytics.bam.action.BAMCommand.execute(BAMCommand.java:76)
    at oracle.bpm.analytics.action.AbstractActionInvoker.processAuditInstance(AbstractActionInvoker.java:216)
    at oracle.bpm.analytics.action.AbstractActionInvoker.processMessage(AbstractActionInvoker.java:95)
    at oracle.bpm.analytics.bam.action.BAMActionMDB.onMessage(BAMActionMDB.java:129)
    at sun.reflect.GeneratedMethodAccessor2127.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy355.onMessage(Unknown Source)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
    at weblogic.ejb.container.internal.MDListener.run(MDListener.java:745)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Clearing all adapter config data, new config of soap jndi and restart weblogic server helped.

  • Waiting for response has timed out and Bad response: 401 Access denied

    Hi,
    I am using a partner link to invoke a wsdl.This wsdl I am downloading from server after giving the username and password details.
    So while invoking it i m providing the credentials details in bpel.xml file .
    <property name="httpBasicHeaders">
    <property name="httpBasicUsername">
    <property name="httpBasicPassword">
    After providing this details also I am getting error .
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 11d1def534ea1be0:-3d858514:1209f42a251:-7da8. Please check the process instance for detail.</faultstring>
    </Fault>
    On cheking to audit instance i m getting the below error:
    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 401 Access denied
    Plz help me out asap.
    Thnaks

    can you please post you bpel.xml file the setting for basic authentication should be as follows. It is unclear if this is how you have it or you posted a subset of the bpel.xml.
    <property name="httpBasicHeaders">credentials</property>
    <property name="httpBasicUsername">your_username</property>
    <property name="httpBasicPassword">your_password</property>
    looking at the error it looks like you have given the wrong credentials.
    cheers
    James

  • JWS & JasperReport, fail to open JPrint with JasperViewer

    Hi,
    I'm developping an application that use JWS and JasperReport. It's a client-server application. The server create the report and save it as JPrint, transfer it to the client and the client open it with JasperViewer. It runs well in local without using JWS, but when JWS is used, the client can't open the jprint with the JasperViewer. Nothing appends, no exception is thrown and the thread of that process is cut off (just stop working). I think it might be a memory lack or something, but I have no evidence of that. Someone know something about it?
    Thanks !!

    Perfect-Might wrote:
    i alrealy checked the logs and nothing apear. It may be useful to see this :
    System.out.println("Pass 2");
    JasperPrint jp = JRPrintXmlLoader.load(response.getAttachment());
    System.out.println("Pass 3");Don't ever do this. It's a waste of your time. Use a debugger so you can step in and out of code and see what's going on. Using System.out isn't going to tell you much, as you've just seen.
    The first line is executed, but not the third and no exception is thrown( If it was the case, it is in a try/catch block with printStackTrace)
    For the profiler, maybe you can show me where I can learn how to use this ?Google for OptimizeIt or JProfiler. NetBeans comes with a free one I hear but I've never used it since I find NetBeans impossible to use for basic needs, much less something as advanced as profiling.

  • AD authentication problems. Problems with groups mapping

    Hi Everyone,
      I have my Edge Xi R2 server up and running with AD authentication fine for the past few months. Today I added another group and got a weird error message. Now no AD works and everytime I try to re-enable it I get this message below. I have deleted all my mapped groups and I still get the message. Has anyone come across this problem before?
    If the problem persists, please delete and re-map into BusinessObjects Enterprise all currently mapped groups
    Thank you,
    Adam

    This error indicates that one or more of your mapped groups, is invalid. (check for SID's in the error or windows event viewer logs)
    You can open a message with support to get help tracing your CMS, or you can try to figure out which (groups may cause hti error.
    To note it's also possible that something else is preventing the CMS from communicating with AD again a good reason to open a ticket.
    Regards,
    Tim

Maybe you are looking for