Throws IllegalArgumentException when use BufferedReader.readLine()

hi
when i use BufferedReader.readLine() to read a html file of Internet,it throws IllegalArgumentException like blow:
java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:575)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:442)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
but it occured sometimes or occured never in a long time!
Why?

It does it because of this bit of code in java.nio.Buffer.position
if ((newPosition < 0) || (newPosition > limit))
      throw new IllegalArgumentException ();So for some reason a bit of the java code has tried to set the position to either less than zero or greater than the limit of the buffer. Not a good idea in either case.
Since this is not your code you can't really do much about it. Try catching the exception and handling it.

Similar Messages

  • ADF application on cluster throw exception when using chrome

    I deploy my ADF application to cluster with one proxy server (myip:7003) and two application server(myip:7004 myip:7005) ( http://docs.oracle.com/cd/E15051_01/wls/docs103/cluster/setup.html )
    It works fine when using firefox and IE8, but throw exception when using chrome
    ####<Mar 1, 2013 3:18:30 PM CST> <Notice> <Diagnostics> <XXX.XXX.com> <server02> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1362122310439> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'server02' has triggered at Mar 1, 2013 3:18:30 PM CST. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = Mar 1, 2013 3:18:30 PM CST SERVER = server02 MESSAGE = [ServletContext@710669610[app:Project1 module:XXX path:/XXX spec-version:2.5]] Servlet failed with Exception
    java.lang.NullPointerException
    at org.apache.myfaces.trinidad.model.BaseMenuModel.setRowKey(BaseMenuModel.java:120)
    at org.apache.myfaces.trinidad.component.UIXTree.createCollectionModel(UIXTree.java:274)
    at org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1513)
    at org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1115)
    at org.apache.myfaces.trinidad.component.UIXTree$RowKeyFacesBeanWrapper.getProperty(UIXTree.java:423)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.getProperty(UIXComponentBase.java:1485)
    at org.apache.myfaces.trinidad.component.UIXTree.getDisclosedRowKeys(UIXTree.java:626)
    at org.apache.myfaces.trinidad.component.UIXTree.__init(UIXTree.java:325)
    at org.apache.myfaces.trinidad.component.UIXCollection._init(UIXCollection.java:1778)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:589)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeFacet(DecorativeBoxRenderer.java:440)
    at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer._encodeCenterPane(DecorativeBoxRenderer.java:704)
    at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeAll(DecorativeBoxRenderer.java:380)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:279)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
    at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
    at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:68)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
    at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
    at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
    at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
    at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
    at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = XXX.XXX.com TXID = CONTEXTID = TIMESTAMP = 1362122310438
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000 Jdeveloper 11.1.2.1.0
    webloigc 10.3
    Please help me , thank you
    Edited by: Rocky.c.Xu on 2013-3-1 上午2:52

    Solved it on my own.
    The sso from Java->ABAP was OK
    I reconfigured the sso from ABAP->JAVA by creating new ABAP certificate and import it to the J2EE.
    Omri

  • [svn:fx-trunk] 10891: Fix for ASDoc throws error when using getter methods for pseudo-inheritance of static constants

    Revision: 10891
    Author:   [email protected]
    Date:     2009-10-06 09:46:47 -0700 (Tue, 06 Oct 2009)
    Log Message:
    Fix for ASDoc throws error when using getter methods for pseudo-inheritance of static constants
    QE notes: None.
    Doc notes: None
    Bugs: SDK-22676
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22676
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java

    Have you tried using com.adobe.air.crypto.EncryptionKeyGenerator instead?

  • Throwing away data after BufferedReader().readline()

    I'm reading very large files - over 1GB. I'm reading sequentially and then writing to another file to create smaller files. Since the input file is so big, I'd like to just remove from memory the already read lines. Is there a way to do this using BufferedReader()?
    Here is my BufferedReader line:
          br = new BufferedReader(new FileReader(new File(rawBill)));Then I have the standard while loop:
                   while ((line = br.readLine()) != null) {
                                       ... write to another file here once all required data is read.
                            }Thanks.

    jverd: I didn't realized the line variable would be
    eligible for GC. Seems like it's just getting
    rewritten to with the next line from the input file.
    It's always holding some data it is not nulled out.Variables are never eligible for GC. Objects are.
    Every time through that loop, a String object is created, and the variable line is pointed at it. The next time through, a new object is created, and line is pointed at the new string. Since line is now no longer pointing at the previous String object, that object is now eligible for GC, unless you pointed some other reference varialbe to it, that survives across loop iterations.
    As long as you don't do something to "save" that String object, at any given time, there's only one that's not eligible for GC. All the previous ones are eligible.
    My issue is with the input file. I assume
    BufferedReader just continuously reads/stores the
    data from the file when all the readLine calls get to
    the end of the designated buffer size? No. BufferedReader just does physical reads in relatively large chunks, the size of which is independent of how many bytes you're actually trying to read. For example, when you call readLine, it may physically read 512 bytes from the file, but the line you're reading may only be 80 bytes long. This helps minimize the overhead of physical reads from the network or file system.
    I don't think
    the previously read data is purged upon the next IO
    read from the file. It would be great if there was
    a method on BufferedReader which would purge all
    previously held data. I don't know what you mean by "purging" data. I don't think that's an issue that applies here.

  • Weblogic throws NullPointerException when using ServiceControl.setTimeout

    We are invoking a SOAP service via a com.bea.control.ServiceControl that was generated from a WSDL (right click WSDL, Generate Service Control) using Weblogic 8.1.6.
    SOAP service execution is successful using an http and https endpoint. However, when setting a timeout via ServiceControl.setTimeout(int millisecods) method, the Weblogic API is throwing a NullPointerException when using an https endpoint. When using an http endpoint with the setTimeout method execution is successful.
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: opening connection to https://[... edit removed ...]
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: Response generation exception
    Throwable: java.lang.NullPointerException
    Stack Trace:
    java.lang.NullPointerException
         at weblogic.net.http.HttpsClient.openWrappedSSLSocket(HttpsClient.java:455)
         at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:235)
         at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:389)
         at weblogic.net.http.HttpsClient.<init>(HttpsClient.java:209)
         at weblogic.net.http.HttpClient.New(HttpClient.java:228)
         at weblogic.net.http.HttpsURLConnection.getHttpClient(HttpsURLConnection.java:246)
         at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:217)
         at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:189)
         at com.bea.wlw.runtime.jws.call.SoapHttpCall.invoke(SoapHttpCall.java:179)
         at com.bea.wlw.runtime.jws.call.SoapHttpCall.invoke(SoapHttpCall.java:80)
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1288)
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1155)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
    DEBUG com.bea.wlw.runtime.jws.call.SoapFault [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: SoapFault exception throwable e
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: response code=0, responseMsg=null
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: closed connection to https://[... edit removed ...]
    WARN WLW.INVOKE.[... edit removed ...] [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: Id=[... edit removed id ...] Method=[... edit removed method ...]; Failure=com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.NullPointerException
    String:null
    Detail:
    END SERVICE FAULT
    ERROR [... edit removed ...]
    [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: ServiceControlException
    com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.NullPointerException
    String:null
    Detail:
    END SERVICE FAULT
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1268)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)

    Thanks for the suggestion. But with -DUseSunHttpHandler=true the Weblogic API is throwing a ClassCastException with or without the timeout value set.
    Failure=com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.ClassCastException
    String:null
    Detail:
    END SERVICE FAULT
    ERROR: ServiceControlException
    com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.ClassCastException
    String:null
    Detail:
    END SERVICE FAULT
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1268)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)

  • Swing hangs when using BufferedReader

    Swing hangs when I use a buffered reader. I must be doing something wrong but don't understand what it is. If I comment out the JFrame at the begining of the following code, the input part works but the Threads window won't display. If I add the JFrame then the window displays but hangs until I type something into the input. I have tried using invokeLater on the second thread with no success. What is going on?
    import boeing.agps.formatting.UtSys;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.SwingUtilities;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments>Types
    * @author slr6053
    * @version $Id: $
    public class Test {
       static BufferedReader bufferedReadderIn = new BufferedReader(
                                                 new InputStreamReader( System.in ) );
       public static void main( String[] args ) {
          new JFrame();
          Thread t = new Thread( new Runnable() {
             public void run() {
                System.out.println( "Before while" );
                while ( true ) {
                   String input;
                   try {
                      System.out.println( "Before input" );
                      input = bufferedReadderIn.readLine();
                      System.out.println( "After input " + input );
                   } catch ( IOException e ) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                   } // read extension
          t.start();
          ThreadsWindow threadsWindow = new ThreadsWindow( "Test Thread" );
          threadsWindow.setVisible( true );
          Thread x = new Thread( threadsWindow, "Threads Window") ;
          x.start();
    * Create a stand-along window that displays the current hierarchy of
    * Thread-Groups and Threads, updating the information every second.
    * A typical output looks like:
    * Note: Thread "AGPS Main" will die and become "Thread-0" at the end of main().
    * <pre>
    * THREAD INFORMATION: 20-SEP-2002 17:49:28.0181
    * ThreadGroup "system": Max Priority = 10
    *  +-> "Signal dispatcher" Priority=5 Daemon=true
    *  +-> "Reference Handler" Priority=10 Daemon=true
    *  +-> "Finalizer" Priority=8 Daemon=true
    *  +ThreadGroup "main": Max Priority = 10
    *  +-+-> "AWT-EventQueue-0" Priority=6 Daemon=false
    *  +-+-> "SunToolkit.PostEventQueue-0" Priority=6 Daemon=false
    *  +-+-> "AWT-Motif" Priority=6 Daemon=false
    *  +-+-> "Screen Updater" Priority=5 Daemon=false
    *  +-+-> "TimerQueue" Priority=5 Daemon=true
    *  +-+-> "Thread-0" Priority=5 Daemon=false
    *  +-+-> "Help Thread" Priority=4 Daemon=false
    *  +-+-> "AGPS Execution" Priority=5 Daemon=false
    *  +-+-> "SEE Threads" Priority=5 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    * </pre>
    * @version $Id: ThreadsWindow.java,v 1.6 2007/08/22 14:39:02 slr6053 Exp $
    class ThreadsWindow extends JFrame implements Runnable, ActionListener {
       private JTextPane textArea ;
       private JButton startStop, closeBtn ;
       private boolean updateInformation = true ;
       private boolean exitThread = false ;
       private Document doc;
       private SimpleAttributeSet att;
       private SimpleAttributeSet attRed;
       private SimpleAttributeSet attBold;
       private SimpleAttributeSet attBold1;
        * Create and show a window that will display the Threads used in the
        * current JVM. The display will be updated every second from a newly
        * created Thread "SEE Threads".
        * @param title The window title for the window.
       public ThreadsWindow( String title ) {
          super( title ) ;
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          textArea = new JTextPane() ;
          att    = new SimpleAttributeSet();
          attBold1 = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold1, true );
          StyleConstants.setFontSize( attBold1, 14 );
          attBold = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold, true );
          attRed = new SimpleAttributeSet();
          StyleConstants.setForeground( attRed, Color.red);
          StyleConstants.setBold( attRed, true );
          doc = textArea.getStyledDocument();
          getContentPane().setLayout( new BorderLayout() ) ;
          getContentPane().add( new JScrollPane().add(
                 new JPanel().add( textArea ) ), BorderLayout.CENTER ) ;
          startStop = new JButton( "Start/Stop" ) ;
          closeBtn = new JButton( "CLOSE" ) ;
          JPanel buttons = new JPanel() ;
          buttons.setLayout( new GridLayout( 0, 2 ) ) ;
          buttons.add( startStop ) ;
          buttons.add( closeBtn ) ;
          startStop.addActionListener( this ) ;
          closeBtn.addActionListener( this ) ;
          getContentPane().add( buttons, BorderLayout.NORTH ) ;
          setSize( 300, 400 ) ;
       } // end of constructor()
        * Handle the buttons.
       public void actionPerformed( ActionEvent e ) {
          Object srcIn = e.getSource() ;
          if( srcIn instanceof JButton ) {
             JButton src = (JButton)srcIn ;
             if( src == startStop ) {
                updateInformation = !updateInformation ;
             } else if( src == closeBtn ) {
                updateInformation = false ;
                exitThread = true ;
                setVisible( true ) ;
                dispose() ;
             } // end else if
          } // end if
       } // end of actionPerformed()
        * While true, sleep 1 second and then repaint.
       public void run() {
          if ( SwingUtilities.isEventDispatchThread() ) new Exception().printStackTrace();
          setVisible( true );
          while( !exitThread ) {            // do forever
             try {
                Thread.sleep( 1000 ) ;  // update every second
             }catch( Exception sEx ) {
             if( updateInformation )
                repaint() ;
          } // end while
       } // end of run()
        * Display the hierarchy of Thread-Groups and Threads.
       public void paint( Graphics g ) {
          super.paint( g ) ;
          if( updateInformation ) {
             try {
                doc.remove(  0, doc.getLength() );
                doc.insertString( 0, "THREAD INFORMATION: " +
                               UtSys.datTimSec() + "\n", attBold1 ) ;
             } catch ( BadLocationException e1 ) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
             ThreadGroup rootT = Thread.currentThread().getThreadGroup();
             while( rootT.getParent() != null ) {
                rootT = rootT.getParent();
             }// end while
             try {
                buildThreadOutput( rootT, "" ) ;
             } catch ( BadLocationException e ) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } // end if
       } // end of paint()
        * Append to the textArea variable the passed ThreadGroup and any
        * Threads it contains. If it contains ant ThreadGroups, invoke this
        * method recursively on each of these threadGroups, etc...
        * @param tg The ThreadGroup to display
        * @param indent The indent-level String to preface each line with.
        *        This method appends "-+" to this String and passes it to the
        *        next recursive invocation.
        * @throws BadLocationException
       private void buildThreadOutput( ThreadGroup tg, String indent ) throws BadLocationException {
          doc.insertString( doc.getLength(),  "   ThreadGroup " +
                           "\"" + tg.getName() + "\":" +
                           " Max Priority = " + tg.getMaxPriority() +
                            "\n", attBold );
          indent = "      ";
          Thread threadArray[] = new Thread[ tg.activeCount() ];
          int threadCount = tg.enumerate( threadArray, false );
          for( int i = 0; i < threadCount; i++ ) {   // THREADS
             Thread thread = threadArray;
    doc.insertString( doc.getLength(), indent + thread.getId()+" "+
    " \"" +thread.getName() +
    "\" Priority=" + thread.getPriority() +
    " Daemon=" + thread.isDaemon() +
    " Active= "+ thread.isAlive() +
    " Interuppted= "+ thread.isInterrupted() +
    "\n", att ) ;
    } // end for
    ThreadGroup threadGroupArray[] = new ThreadGroup[
    tg.activeGroupCount() ];
    int threadGroupCount = tg.enumerate( threadGroupArray, false );
    for( int i = 0; i < threadGroupCount; i++ ) { // THREADGROUPS
    buildThreadOutput( threadGroupArray[i], indent ) ;
    } // end for
    } // end of buildThreadOutput
    } // end of ThreadsWindow class

    OK, this code is closer to my application. If I have the JFrame code in, it works but hangs - that is you can type in "doit" in the command line and the window comes up, and you need to type something else in the command window in order for the ThreadWindow to start updating. If you try to move the ThreadWindow it hangs.
    If you comment out the begining JFrame, the ThreadsWindow never starts. What is that I'm not understanding. The BufferedReader is not in the Main thread, it is in its own thread.
    import boeing.agps.formatting.UtSys;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments>Types
    * @author slr6053
    * @version $Id: $
    public class Test {
       static BufferedReader bufferedReadderIn = new BufferedReader(
                                                 new InputStreamReader( System.in ) );
       protected static boolean condition = false;
       public static void main( String[] args ) {
          new JFrame();
          Thread t = new Thread( new Runnable() {
             public void run() {
                System.out.println( "Before while" );
                while ( true ) {
                   String input;
                   try {
                      System.out.println( "Before input" );
                      input = bufferedReadderIn.readLine();
                      System.out.println( "After input " + input );
                      if ( input.equals( "doit" )) {
                         System.out.println("DOIT");
                         condition  = true;
                   } catch ( IOException e ) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                   } // read extension
          System.out.println("First thread started");
          t.start();
          ThreadsWindow threadsWindow = new ThreadsWindow( "Test Thread" );
          Thread x = new Thread( threadsWindow, "Threads Window") ;
          System.out.println("Second thread started");
          x.start();
        * @return Returns condition.
       public static boolean isCondition() {
          return condition;
    * Create a stand-along window that displays the current hierarchy of
    * Thread-Groups and Threads, updating the information every second.
    * A typical output looks like:
    * Note: Thread "AGPS Main" will die and become "Thread-0" at the end of main().
    * <pre>
    * THREAD INFORMATION: 20-SEP-2002 17:49:28.0181
    * ThreadGroup "system": Max Priority = 10
    *  +-> "Signal dispatcher" Priority=5 Daemon=true
    *  +-> "Reference Handler" Priority=10 Daemon=true
    *  +-> "Finalizer" Priority=8 Daemon=true
    *  +ThreadGroup "main": Max Priority = 10
    *  +-+-> "AWT-EventQueue-0" Priority=6 Daemon=false
    *  +-+-> "SunToolkit.PostEventQueue-0" Priority=6 Daemon=false
    *  +-+-> "AWT-Motif" Priority=6 Daemon=false
    *  +-+-> "Screen Updater" Priority=5 Daemon=false
    *  +-+-> "TimerQueue" Priority=5 Daemon=true
    *  +-+-> "Thread-0" Priority=5 Daemon=false
    *  +-+-> "Help Thread" Priority=4 Daemon=false
    *  +-+-> "AGPS Execution" Priority=5 Daemon=false
    *  +-+-> "SEE Threads" Priority=5 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    * </pre>
    * @author Tom Dickens
    * @version $Id: ThreadsWindow.java,v 1.6 2007/08/22 14:39:02 slr6053 Exp $
    class ThreadsWindow extends JFrame implements Runnable, ActionListener {
       private JTextPane textArea ;
       private JButton startStop, closeBtn ;
       private boolean updateInformation = true ;
       private boolean exitThread = false ;
       private Document doc;
       private SimpleAttributeSet att;
       private SimpleAttributeSet attRed;
       private SimpleAttributeSet attBold;
       private SimpleAttributeSet attBold1;
        * Create and show a window that will display the Threads used in the
        * current JVM. The display will be updated every second from a newly
        * created Thread "SEE Threads".
        * @param title The window title for the window.
       public ThreadsWindow( String title ) {
          super( title ) ;
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          textArea = new JTextPane() ;
          att    = new SimpleAttributeSet();
          attBold1 = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold1, true );
          StyleConstants.setFontSize( attBold1, 14 );
          attBold = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold, true );
          attRed = new SimpleAttributeSet();
          StyleConstants.setForeground( attRed, Color.red);
          StyleConstants.setBold( attRed, true );
          doc = textArea.getStyledDocument();
          getContentPane().setLayout( new BorderLayout() ) ;
          getContentPane().add( new JScrollPane().add(
                 new JPanel().add( textArea ) ), BorderLayout.CENTER ) ;
          startStop = new JButton( "Start/Stop" ) ;
          closeBtn = new JButton( "CLOSE" ) ;
          JPanel buttons = new JPanel() ;
          buttons.setLayout( new GridLayout( 0, 2 ) ) ;
          buttons.add( startStop ) ;
          buttons.add( closeBtn ) ;
          startStop.addActionListener( this ) ;
          closeBtn.addActionListener( this ) ;
          getContentPane().add( buttons, BorderLayout.NORTH ) ;
          setSize( 300, 400 ) ;
       } // end of constructor()
        * Handle the buttons.
       public void actionPerformed( ActionEvent e ) {
          Object srcIn = e.getSource() ;
          if( srcIn instanceof JButton ) {
             JButton src = (JButton)srcIn ;
             if( src == startStop ) {
                updateInformation = !updateInformation ;
             } else if( src == closeBtn ) {
                updateInformation = false ;
                exitThread = true ;
                setVisible( true ) ;
                dispose() ;
             } // end else if
          } // end if
       } // end of actionPerformed()
        * While true, sleep 1 second and then repaint.
       public void run() {
          while( !exitThread ) {            // do forever
             if ( Test.isCondition()  ) {
                setVisible( true );
                try {
                   Thread.sleep( 1000 ); // update every second
                } catch ( Exception sEx ) {
                if ( updateInformation )
                   repaint();
             } // end if
          } // end while
       } // end of run()
        * Display the hierarchy of Thread-Groups and Threads.
       public void paint( Graphics g ) {
          super.paint( g ) ;
          if( updateInformation ) {
             try {
                doc.remove(  0, doc.getLength() );
                doc.insertString( 0, "THREAD INFORMATION: " +
                               UtSys.datTimSec() + "\n", attBold1 ) ;
             } catch ( BadLocationException e1 ) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
             ThreadGroup rootT = Thread.currentThread().getThreadGroup();
             while( rootT.getParent() != null ) {
                rootT = rootT.getParent();
             }// end while
             try {
                buildThreadOutput( rootT, "" ) ;
             } catch ( BadLocationException e ) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } // end if
       } // end of paint()
        * Append to the textArea variable the passed ThreadGroup and any
        * Threads it contains. If it contains ant ThreadGroups, invoke this
        * method recursively on each of these threadGroups, etc...
        * @param tg The ThreadGroup to display
        * @param indent The indent-level String to preface each line with.
        *        This method appends "-+" to this String and passes it to the
        *        next recursive invocation.
        * @throws BadLocationException
       private void buildThreadOutput( ThreadGroup tg, String indent ) throws BadLocationException {
          doc.insertString( doc.getLength(),  "   ThreadGroup " +
                           "\"" + tg.getName() + "\":" +
                           " Max Priority = " + tg.getMaxPriority() +
                            "\n", attBold );
          indent = "      ";
          Thread threadArray[] = new Thread[ tg.activeCount() ];
          int threadCount = tg.enumerate( threadArray, false );
          for( int i = 0; i < threadCount; i++ ) {   // THREADS
             Thread thread = threadArray;
    doc.insertString( doc.getLength(), indent + thread.getId()+" "+
    " \"" +thread.getName() +
    "\" Priority=" + thread.getPriority() +
    " Daemon=" + thread.isDaemon() +
    " Active= "+ thread.isAlive() +
    " Interuppted= "+ thread.isInterrupted() +
    "\n", att ) ;
    } // end for
    ThreadGroup threadGroupArray[] = new ThreadGroup[
    tg.activeGroupCount() ];
    int threadGroupCount = tg.enumerate( threadGroupArray, false );
    for( int i = 0; i < threadGroupCount; i++ ) { // THREADGROUPS
    buildThreadOutput( threadGroupArray[i], indent ) ;
    } // end for
    } // end of buildThreadOutput
    } // end of ThreadsWindow class

  • IllegalArgumentException when using Introspector to get bean info

    hi all
    i have a bean class that has two strings and one vector. when i use introspector to read and write bean value to a new object of same type, i got an IllegalArgumentException :
    Exception in thread "main" java.lang.IllegalArgumentException: argument type mis
    match
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at IntrospectTest.copy(IntrospectTest.java:61)it happens when it tried to access the vector which contains two string values. here is my method
         public static Object copy(Object o)
              System.out.println("in copy...");
              Object newObject = null;
              System.out.println("object : "+o);
              try
                   Class c = o.getClass();
                   System.out.println("Class from o : "+c);
                   newObject = c.newInstance();
                   System.out.println("newObject : "+newObject);
                   PropertyDescriptor p[] = null;
                   p = Introspector.getBeanInfo(o.getClass()).getPropertyDescriptors();          
                   Object[] args = new Object[1];
                   System.out.println("p has "+p.length+" elements");
                   for (int i = 0; i < p.length; i++)
                        String name = p.getName();
                        System.out.println("name : "+name);
                        if(!"class".equals(name))
                             Object value = p[i].getReadMethod().invoke(o, new Object[0]);
                             System.out.println("value : "+value);
                             args[0] = name;
                             p[i].getWriteMethod().invoke(newObject, args);
              }catch (IntrospectionException ie)
                   System.out.println("IntrospectionException : "+ie.getMessage());
              }catch (InvocationTargetException ite)                     
                   System.out.println("InvocationTargetException : "+ite.getMessage());
              }catch (IllegalAccessException ile)
                   System.out.println("IllegalAccessException : "+ile.getMessage());
              }catch(InstantiationException ine)
                   System.out.println("InstantiationException : "+ine.getMessage());
              return newObject;
    does anyone know how i can read and write vector object in a bean? thanks.

    Normally I would be happy to help you, but after several years of trying to help here, I've decided not to contribute anymore because of the piss-poor way in which this site is being administered.
    Others are still helping, but more may leave if things don't improve. May I recommend devshed or javaranch?
    http://www.devshed.com/
    http://www.javaranch.com/
    If you would like to complain to the admins of this forum, either click the "Report Abuse" link or the "Feedback" link.
    The forum denizen formerly known as jverd

  • IllegalArgumentException when using Constructor expression in Named Query.

    I have the following JPQL-query:
    SELECT NEW se.callista.test.dto.EmployeeReportData(e.firstName, e.lastName, a.city, e.employmentPeriod.startDate) FROM Employee e JOIN e.address a ORDER BY e.lastName, e.firstNamewhere EmployeeReportData is a dto (not an entity). The query works fine when running it as a normal query. When I put it as a named query however, I get the following error message when trying to execute it: java.lang.IllegalArgumentException: Object: se.callista.test.dto.EmployeeReportData@10f9644 is not a known entity type.
    I can't find anything in the JPA-spec that says a named query cannot contain a constructor expression - am I missing something?
    Found the error. It works fine now :)
    Message was edited by:
    Sofia_Jonsson

    I had the same problem.
    It seems that the Entity class is not loaded by the JVM at the moment of calling createNamedQuerey(string).
    I've solved this problem by loading the entity class manually in the caller by calling "Class.forName(string)" and passing the entity's class name as a parameter.

  • Snapshot() throws IllegalArgumentException when invoked from ActionEvent

    I've got a program in which I need to create a snapshot of a Node in response to a button press. However, I always get the following Exception, even if I invoke it from a Platform.runLater() call instead of directly under the ActionEvent method. Does anybody know what causes this and how to get around it? I've had snapshot() work for me in other contexts.
    java.lang.IllegalArgumentException: Unrecognized image loader: null
        at javafx.scene.image.WritableImage.loadTkImage(WritableImage.java:230)
        at javafx.scene.image.WritableImage.access$000(WritableImage.java:44)
        at javafx.scene.image.WritableImage$1.loadTkImage(WritableImage.java:49)
        at javafx.scene.Scene.doSnapshot(Scene.java:1144)
        at javafx.scene.Node.doSnapshot(Node.java:1632)
        at javafx.scene.Node.snapshot(Node.java:1710)
        at highreseffecttest.HighResEffectTest$1.handle(HighResEffectTest.java:54)
        at highreseffecttest.HighResEffectTest$1.handle(HighResEffectTest.java:50)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
        at javafx.event.Event.fireEvent(Event.java:171)
        at javafx.scene.Node.fireEvent(Node.java:6867)
        at javafx.scene.control.Button.fire(Button.java:179)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
        at javafx.event.Event.fireEvent(Event.java:171)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
        at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
        at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
        at com.sun.glass.ui.View.notifyMouse(View.java:924)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
        at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
        at java.lang.Thread.run(Thread.java:744)

    A few ideas, none tried:
    Take multiple snapshots of the node setting snapshot parameters on each snapshot with different viewports set on the parameters, then stitch together the resultant snapshot images
    or reduce the image resolution prior to taking a snapshot
    or try a video card with more texture memory
    Also log a bug in Jira.

  • Bug with InputStream.read after BufferedReader.readLine in a Thread ?

    I just found something strange when reading bytes on a socket after reading lines.
    I'll show you an example :
    In this example, when a connexion is established, I launch a thread where a single line of String then 3 bytes are read from the socket. I use BufferedReader.readLine for the String line then just InputStream.read to read the 3 bytes.
    The results are quite random. Sometimes it works, sometimes not (most times it doesn't)... it seems to always work under linux (but haven't tested it as many times than on windows). Most of the time the program is stuck on the "socket.getInputStream().read(bytes);" line with 0 bytes available. I tried to do the same thing outside of a thread, I thought it worked better beaucause I was able to run it without any problem but it doesn't work anymore when I test it again.
    I can't say if I'm doing something wrong or if it's a java bug (I've got JDK 1.6.0_03-b05).
    Can you please have a look a this little example and maybe test it and let me know if it works or not. I tried to code my own readLine function and it seems to work with it but I'd like to know if it's a bug or what. Thank you.
    Server side :
    import java.io.*;
    import java.net.*;
    public class testServer extends Thread {
         private Socket socket;
         public testServer(Socket testSocket)
              socket = testSocket;
         public void readData() throws Exception
              BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              String str;
              str = br.readLine();
              System.out.println(str);
              System.out.println("Bytes available : " + socket.getInputStream().available());
                    //Try to read the bytes
                    byte[] bytes = new byte[3];
                    //STOPS THERE UNDER WINDOWS, BUT WORKS WITH LINUX
              socket.getInputStream().read(bytes);
                    //Simple "ack" to say to the client that he can close the connexion
              socket.getOutputStream().write(0);
              socket.getOutputStream().flush();
                    //Print the bytes values
              for(byte value : bytes)
                   System.out.println(value);
         public void run()
              try {
                   readData();
              } catch (Exception e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   ServerSocket welcomeSocket = new ServerSocket(3333);
                   while(true)
                        new testServer(welcomeSocket.accept()).start();
              } catch (Exception e) {
                   e.printStackTrace();
    }client side :
    import java.io.*;
    import java.net.*;
    public class testClient {
         public static void main(String[] args) {
              try {
                            //Some test values
                   byte[] testValues = new byte[]{1,2,3};
                   Socket socket = new Socket(InetAddress.getLocalHost(), 3333);
                            //Send the line through the socket
                   BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
                   bw.write("HELLO WORLD\r\n");
                   bw.flush();
                            //then the bytes
                   socket.getOutputStream().write(testValues);
                   socket.getOutputStream().flush();
                            //Just waits for the server's ack to close the connexion
                   socket.getInputStream().read();
                   socket.close();
              } catch (Exception e) {
                   e.printStackTrace();
    }

    It's your bug.
    When you create a BufferedReader and ask it to read a line, the first thing it does is to read a whole buffer full of data (hence the name of the class) from its underlying input stream. That's probably about 4000 characters or something like that. It stores that internally and then starts doling it out in response to calls to readLine() and so on.
    Then when you go back to reading from the underlying input stream, those 4000 or so characters are already gone from it. You have no access to the data the BufferedReader is hanging on to this way. All you can do is to start reading at the point after that whole buffer, which is not what you want.

  • Jax-ws 2.2.8 and ws-addressing: Client throwing java.lang.NullPointerException on receipt of HTTP 202 when using non-anonymous ReplyTo address

    Server: JBoss EAP 6.2.0
    Client: JDK 1.7.0_51 x64
    JAX-WS: RI 2.2.8 ( via -Djava.endorsed.dirs )
    I am getting a java.lang.NullPointerException when calling the operation on the WS endpoint from the client when using non-anonymous replyTo address.
    I have simplified the scenario into a small test case that hopefully others can replicate. Since the exception is happening on the client instead of the server, I would think that the container used is irrelevant, but I have specified it nonetheless.
    1) WebService:
    package test.webservice;
    import java.util.Random;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.xml.ws.soap.Addressing;
    @WebService(targetNamespace="http://services.nowhere.org/")
    @Addressing(required=true)
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
    public class RandomTest {
        @WebMethod
        public long nextRandom(@WebParam boolean forceException) throws Exception {
            if( forceException ) {
                throw new Exception("Some exception");
            Random rand = new Random();
            return rand.nextLong();
    2) Generated WSDL by JBossEAP 6.2.2:
    <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://webservice.test/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="RandomTestService" targetNamespace="http://webservice.test/">
      <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.test/" elementFormDefault="unqualified" targetNamespace="http://webservice.test/" version="1.0">
      <xs:element name="nextRandom" type="tns:nextRandom"/>
      <xs:element name="nextRandomResponse" type="tns:nextRandomResponse"/>
      <xs:complexType name="nextRandom">
        <xs:sequence/>
      </xs:complexType>
      <xs:complexType name="nextRandomResponse">
        <xs:sequence>
          <xs:element name="return" type="xs:long"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
      </wsdl:types>
      <wsdl:message name="nextRandom">
        <wsdl:part element="tns:nextRandom" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="nextRandomResponse">
        <wsdl:part element="tns:nextRandomResponse" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="RandomTest">
        <wsdl:operation name="nextRandom">
          <wsdl:input message="tns:nextRandom" name="nextRandom" wsam:Action="http://webservice.test/RandomTest/nextRandomRequest" wsaw:Action="http://webservice.test/RandomTest/nextRandomRequest">
        </wsdl:input>
          <wsdl:output message="tns:nextRandomResponse" name="nextRandomResponse" wsam:Action="http://webservice.test/RandomTest/nextRandomResponse" wsaw:Action="http://webservice.test/RandomTest/nextRandomResponse">
        </wsdl:output>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="RandomTestServiceSoapBinding" type="tns:RandomTest">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsaw:UsingAddressing wsdl:required="true"/>
        <wsp:PolicyReference URI="#RandomTestServiceSoapBinding_WSAM_Addressing_Policy"/>
        <wsdl:operation name="nextRandom">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="nextRandom">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="nextRandomResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="RandomTestService">
        <wsdl:port binding="tns:RandomTestServiceSoapBinding" name="RandomTestPort">
          <soap:address location="http://localhost:8080/servertest/RandomTest"/>
        </wsdl:port>
      </wsdl:service>
        <wsp:Policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="RandomTestServiceSoapBinding_WSAM_Addressing_Policy"><wsam:Addressing><wsp:Policy/></wsam:Addressing></wsp:Policy>
    </wsdl:definitions>
    3) ant build.xml to generate the client code from WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="build" basedir="..">
        <property name="jaxws.classpath" location="C://jaxws-2.2.8/jaxws-ri/lib/*.jar"/>
        <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
               <classpath path="${jaxws.classpath}"/>
        </taskdef>
        <target name="build" >
            <!-- For these to work, the JAR files in tools/jaxws-ri must be included in Ant's classpath -->
            <wsimport wsdl="http://localhost:8080/servertest/RandomTest?wsdl"
                   verbose="true"
                   sourcedestdir="src"
                   destdir="bin"
                   keep="true">
                   <xjcarg value="-enableIntrospection"/>
            </wsimport>
        </target>
    </project>
    4) Client code
    4a) ClientTest.java - Actual client run from client
    package test.wsclient;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.ws.BindingProvider;
    import javax.xml.ws.Endpoint;
    import javax.xml.ws.handler.Handler;
    import javax.xml.ws.soap.AddressingFeature;
    import org.nowhere.services.RandomTest;
    import org.nowhere.services.RandomTestService;
    public class ClientTest {
        public static void main(String args[]) throws Exception {
            ClientTest app = new ClientTest();
            app.testAddressing();
        public void testAddressing() throws Exception {
            String REPLY_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallback";
            String FAULT_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallbackFault";
            RandomTestService service = new RandomTestService();
            RandomTest port = service.getRandomTestPort(new AddressingFeature());
            BindingProvider provider = (BindingProvider) port;
            // pass the replyTo address to the handler
            provider.getRequestContext().put("ReplyTo", REPLY_TO_ADDRESS);
            provider.getRequestContext().put("FaultTo", FAULT_TO_ADDRESS);
            // Register handlers to set the ReplyTo and FaultTo on the SOAP request sent to the WS endpoint
            List<Handler> handlerChain = new ArrayList<Handler>();
            handlerChain.add(new ClientHandler());
            provider.getBinding().setHandlerChain(handlerChain);
            // Start endpoint to receive callbacks from WS
            Endpoint endpoint = Endpoint.publish(REPLY_TO_ADDRESS, new CallbackSEI());
            try {
                port.nextRandom(false);
            } catch( Exception ex ) {
                ex.printStackTrace();
            } finally {
                Thread.sleep(10000);
            endpoint.stop();
            System.exit(0);
    4b) ClientHandler.java - Used to set the wsa ReplyTo address and FaultTo address when sending SOAP request from client to server
    package test.wsclient;
    import java.util.Set;
    import javax.xml.namespace.QName;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.MessageContext.Scope;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ClientHandler implements SOAPHandler<SOAPMessageContext> {
        public ClientHandler() {};
        @Override
        public Set<QName> getHeaders() {
            return null;
        @Override
        public void close(MessageContext arg0) {
        @Override
        public boolean handleFault(SOAPMessageContext context) {
            return true;
        protected void setAnAddress(SOAPHeader header, String tagName, String address) {
            NodeList nodeListReplyTo = header.getElementsByTagName(tagName);
            NodeList nodeListAddress = nodeListReplyTo.item(0).getChildNodes();
            for (int i = 0; i < nodeListAddress.getLength(); i++) {
                Node node = nodeListAddress.item(i);
                if ("Address".equals(node.getLocalName())) {
                    node.setTextContent(address);
                    break;
        protected String getMessageID(SOAPHeader header) {
            NodeList nodeListMessageId = header.getElementsByTagName("MessageID");
            return nodeListMessageId.item(0).getTextContent();
        @Override
        public boolean handleMessage(SOAPMessageContext context) {
            Boolean isOutbound = (Boolean) context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (isOutbound) {
                try {
                    SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
                    SOAPHeader header = envelope.getHeader();
                    /* extract the generated MessageID */
                    String messageID = getMessageID(header);
                    context.put("MessageID", messageID);
                    context.setScope("MessageID", Scope.APPLICATION);
                    /* change ReplyTo address */
                    setAnAddress(header, "ReplyTo", (String) context.get("ReplyTo"));
                    setAnAddress(header, "FaultTo", (String) context.get("FaultTo"));
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
            return true;
    4c) CallbackSEI.java - endpoint on the client for server to send the SOAP response back to the client
    package test.wsclient;
    import javax.annotation.Resource;
    import javax.jws.Oneway;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.ws.Action;
    import javax.xml.ws.RequestWrapper;
    import javax.xml.ws.WebServiceContext;
    import javax.xml.ws.soap.Addressing;
    @WebService
    @Addressing
    //@HandlerChain(file = "/handler-chain.xml")
    public class CallbackSEI {
        @Resource
        private WebServiceContext context;
         * If there is no namespace specified in the method below, then the CallbackSEI needs to be in the same package as the
         * WS endpoint.
        @Oneway
        @Action(input="http://services.nowhere.org/RandomTest/nextRandomResponse")
        @RequestWrapper(localName="nextRandomResponse", targetNamespace="http://services.nowhere.org/")
        public void handleNotification(@WebParam(name="return")long random) {
            System.out.println("Asynch response received");
            System.out.println( random );
            //System.out.println("This response relates to the message ID: "+ getMessageID());
    In summary:
    Server is listening on port 8080
    Client will listen in port 8082 for the callback from the server for the SOAP response
    Now when I run the client, I see that the proper behaviour as far as ws-addressing is concerned. That is:
    client  -- SOAP request ( on port 8080 ) --> server
    client <-- HTTP 202 ( empty HTTP body )  --- server
    client <-- SOAP response ( on port 8082 )  --- server
    All well and good, except that I am getting a NullPointerException on the client side when I call the operation.
    With debugging of the SOAP request and responses, I get the following output:
    ---[HTTP request - http://localhost:8080/servertest/RandomTest]---
    Accept: text/xml, multipart/related
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "http://services.nowhere.org/RandomTest/nextRandomRequest"
    User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
    <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/servertest/RandomTest</To><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomRequest</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallback</Address>
    </ReplyTo><FaultTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallbackFault</Address>
    </FaultTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</MessageID></S:Header><S:Body><ns2:nextRandom xmlns:ns2="http://services.nowhere.org/"><arg0>false</arg0></ns2:nextRandom></S:Body></S:Envelope>--------------------
    ---[HTTP response - http://localhost:8080/servertest/RandomTest - 202]---
    null: HTTP/1.1 202 Accepted
    Content-Length: 0
    Content-Type: text/xml;charset=UTF-8
    Date: Fri, 18 Jul 2014 08:34:36 GMT
    Server: Apache-Coyote/1.1
    java.lang.NullPointerException
        at com.sun.proxy.$Proxy38.nextRandom(Unknown Source)
        at test.wsclient.ClientTest.testAddressing(ClientTest.java:43)
        at test.wsclient.ClientTest.main(ClientTest.java:18)
    ---[HTTP request]---
    Cache-control: no-cache
    Host: localhost:8082
    Content-type: text/xml; charset=UTF-8
    Content-length: 704
    Connection: keep-alive
    Pragma: no-cache
    User-agent: Apache CXF 2.7.7.redhat-1
    Accept: */*
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomResponse</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:65d8d7fc-09e4-494a-a9c5-0a01faf4d7e6</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8082/servertest/RandomCallback</To><RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</RelatesTo></soap:Header><soap:Body><ns2:nextRandomResponse xmlns:ns2="http://services.nowhere.org/"><return>2870062781194370669</return></ns2:nextRandomResponse></soap:Body></soap:Envelope>--------------------
    Asynch response received
    2870062781194370669
    As you can see from the output above, the proxy is throwing an Exception when it receives the HTTP 202 response.
    Any ideas ?

    I think I have found when I get this error and probably I have found a bug. I will appreciate if someone can confirm this.
    In my BPEL project setup, my BPEL process's wsdl file imports another wsdl from different namespace. Here is sample snippet -
    <wsdl:definitions targetNamespace="http://namespace/1">
    <wsdl:import namespace="http://namespace/2" location="resources/another.wsdl"/>
    <plnk:partnerLinkType....../>
    </wsdl:definitions>
    Please let me know. I checked the bundled samples with Oracle BPEL PM and did not find any similar case where process wsdl imports another wsdl.
    Thank you.
    Meghana

  • No need to add 'throws' when throwing IllegalArgumentException ?

    Why is it necessary to add throws/try catch when throwing Exception but not when throwing IllegalArgumentException :
      public void test(String a, String b)  {
        if(a.equals.b) {
              // Do stuff
        } else {
          throw new IllegalArgumentException("bla"); // Ok!
          // throw new Exception("bla");       NO GO!
      }

    Also, it is usually less than helpful to throw Exception. Try to find the correct subclass exception to provide better info the the poor schmuck who has to handle your exception. Write your own ... it is very easy.
    ¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Firefox throws "This Connection is Untrusted" when using hostname, but not when using IP address

    I am remotely accessing a website which has iFrame in it. The website uses https, but iFrame tag has "src" pointing to a site using http only. However, when I remotely go to the site, iFrame shows the message below although the ''src" url is http only (there is no SSL certificate) when I use IP address (https://10.10.101.156:8006/apprecovery/admin/Core/Storage) in address bar instead of hostname (https://hostname:8006/apprecovery/admin):
    ===
    This Connection is Untrusted
    You have asked Firefox to connect
    securely to d37t50w1, but we can't confirm that your connection is secure.
    Normally, when you try to connect securely,
    sites will present trusted identification to prove that you are
    going to the right place. However, this site's identity can't be verified.
    What Should I Do?
    If you usually connect to
    this site without problems, this error could mean that someone is
    trying to impersonate the site, and you shouldn't continue.
    d37t50w1 uses an invalid security certificate.
    The certificate is not trusted because it is self-signed.
    (Error code: sec_error_ca_cert_invalid)
    ===
    Why is it giving this when using hostname but not when IP address is using?

    Corrected first para above:
    I am remotely accessing a website which has iFrame in it. The website uses https, but iFrame tag has "src" pointing to a site using http only. However, when I remotely go to the site, iFrame shows the message below although the "src" url is http only (there is no SSL certificate) when I use hostname address (https://<hostname>:8006/apprecovery/admin) in address bar. But I dont see the message in iFrame when I instead use IP Address (https://<IP Address>:8006/apprecovery/admin) to go to main website.

  • How to trap null return values from getters when using Method.invoke()?

    Hi,
    I am using Method.invoke() to access getters in an Object. I need to know which getters return a value and which return null. However, irrespective of the actual return value, I am always getting non-null return value when using Method.invoke().
    Unfortunately, the API documentation of Method.invoke() does not specify how it treats null return values.
    Can someone help?
    Thanks

    What do you get as a result?I think I know what the problem is.
    I tested this using following and it worked fine:
    public class TestMethodInvoke {
    public String getName() {
    return null;
    public static void main(String args[]) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
    Object o = new TestMethodInvoke();
    Class cls = o.getClass();
    Method m = cls.getMethod("getName", (Class[]) null);
    Object result = m.invoke(o, (Object[])null);
    if (result == null) {
    System.err.println("OK: Return value was null as expected");
    else {
    System.err.println("FAILED: Return value was NOT null as expected");
    However, when I use the same technique with an EJB 3.0 Entity class, the null return value is not returned. Instead, I get a String() object. Clearly, the problem is the the EJB 3.0 implementation (Glassfish/Toplink) which is manipulating the getters.
    Regards
    Dibyendu

  • Using BufferedReader to get Unicode data from a .php site

    Hi,
    Probably a rather mundane question. I'm working on an applet which uses a .php site as a proxy to get at data found in a mySQL database. It's working adequately for text consisting of standard English characters only - the only problem is that every time I read in a file, it starts with the characters ""
    It's not working at all for text using other characters - I get an incomprehensible string of characters in Java when I try that.
    So my assumption is that Java does not understand that my php document is in Unicode, and is trying to read it using a different encoding system. I use unicode charaters elsewhere in this applet and have no problems with them, so I am assumign it must be an I/O error.
    What do I have to do to make Java realize that this is unicode?
    Here's the relevant code as it is now:
    String goTo = "http://[...]/info.php?search=" + toLink(search);
    URL test = new URL(goTo);
    URLConnection testConnection = test.openConnection();
    BufferedReader dis = new BufferedReader(new InputStreamReader(testConnection.getInputStream()));
    String inputLine;
    while ((inputLine = dis.readLine()) != null) {
                    giveout += inputLine;
    dis.close();The String giveout should have all the data from the document in it after this.
    Or do I need to change something about my php, which, as it is now, just displays the data from my database, with no HTML tags whatsoever?

    You probably have a 'byte order marker' ( BOM ) at the beginning of the file. You can use my BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 or you can just discard the BOM bytes from the InputStream before wrapping it in the BufferedReader.
    Hi Sabre im facin the same probem.
    bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
    bufferedReader.readLine() returns a junk character ? at the beginning of the line.
    you have instructed to use your BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 but i dotn know how to use it with bufferedReader because i want my method to return only a BufferedReader object.
    can you suggest me how to go about it.
    my code is as below need help.
    public BufferedReader check(){
                     bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
            return bufferedReader; // need to return bufferedReader object only...since some other code needs bufferedReader ...suggest me.
    i will be highly obliged if you paste the refined code.. please need your urgent help on this...
    Regards
    Deepak

Maybe you are looking for

  • (ORA-06508: PL/SQL: could not find program unit being called) utl_file

    hi all, I am using Oracle XE and forms 6i and am facing the above error when i try to use the utl_file utility. WHEN BUTTOn PRESSED      IF (:EXPORT_IMPORT_DATA = 'E') THEN           message(lc_status);                          SECURITY.PKG_gen_trnsf

  • Jconsole no longer works with Java 6.0, it did with 5.0

    Hello, We are having a very important issue. We have reproduced the situation in 10 out of 10 computers, all with the same result, even in fresh installations. Using jconsole, we are connecting to the following service (BEA weblogic 10): service:jmx:

  • CRXI R2 and VS 2005 select expert

    Hello Every One, For our Project we use CR XI 2 and VS2005. We use ODBC connection to run the reports. At the time of designing the report i have added the paramter and filler to select expert. In our windows application I asses the parameter and ass

  • BIG PROBLEM! My Ipod Shuffle won't update!

    I'm having trouble with my Ipod shuffle 2nd gen. Every time I try to update it, it won't update. And when I try to charge it, it will only charge when I'm not using Itunes. I really need my shuffle right now this month because I'm going on important

  • Does upgrading my OS affect my injected smartphone?

    I have injected blackberry curve 9330 CDMA smartphone and I just want to upgrade it's OS. But I'm afraid that upgrading my OS will take changes on my injected smartphone because of the warning on the label that said: "After completing the loading ope