ADF java.io.IOException: flow closed and XML-22031:

Hello

I'm on JDeveloper 11.1.2.0.0

I am trying to generate PDFs of ADF button

1)
Get the error
[030513_091553573] [] [ERROR] java.io.IOException: closed stream


I use code below
        String Tempath = "C:\\JDeveloper\\mywork\\xxPdfTestApp\\PDFTemplate\\TemplateT.rtf";
        InputStream inputStr = FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream(Tempath);
2)
Another error
XML-22031: Undefined Variable (error): "_XDONFSEPARATORS."




Appreciate your help.


Thank you
JIT

Published by: appsjit on March 5, 2013 11:56

Published by: appsjit on March 5, 2013 12:59

Following also generates an error?

String Tempath = "C:/JDeveloper/mywork/xxPdfTestApp/PDFTemplate/TemplateT.rtf";
InputStr InputStream = new FileInputStream (new File (Tempath));

Tags: Java

Similar Questions

  • "java.io.IOException: write channel closed" starting AdminServer WLST

    Hello

    I'm trying to start the server administration through WLST.
    By "Oracle® Fusion Middleware WebLogic Scripting Tool Command référence 11 g Release 1 (10.3.2)" I tried both - online and offline.

    When online

    WLS: / nm/ClassicDomain > startServer ('AdminServer', 'ClassicDomain','t3: / / 10.110.90.156:7002', 'weblogic', '< password >', ' / u0/app/oracle/product/middleware/user_projects/domains ')

    I'm getting

    Start the AdminServer server...
    Traceback (innermost last):
    Folder "system <>", line 1, in?
    File '< iostream >", line 412, in startServer
    at com.certicom.tls.record.WriteHandler.write (unknown Source)
    at com.certicom.io.OutputSSLIOStreamWrapper.write (unknown Source)
    at sun.nio.cs.StreamEncoder.writeBytes (StreamEStarting Server AdminServer...
    Traceback (innermost last):
    Folder "system <>", line 1, in?
    File '< iostream >", line 412, in startServer
    at com.certicom.tls.record.WriteHandler.write (unknown Source)
    at com.certicom.io.OutputSSLIOStreamWrapper.write (unknown Source)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
    at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
    at java.io.BufferedWriter.flush(BufferedWriter.java:236)
    at weblogic.nodemanager.common.DataFormat.writeCommand(DataFormat.java:243)
    at weblogic.nodemanager.client.NMServerClient.sendCmd(NMServerClient.java:320)
    at weblogic.nodemanager.client.NMServerClient.sendServer(NMServerClient.java:265)
    at weblogic.nodemanager.client.NMServerClient.start(NMServerClient.java:94)
    at weblogic.management.scripting.NodeManagerService.nmStart(NodeManagerService.java:368)
    at weblogic.management.scripting.LifeCycleHandler.startSvr(LifeCycleHandler.java:887)
    at weblogic.management.scripting.WLScriptContext.startSvr(WLScriptContext.java:384)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    java.io.IOException: java.io.IOException: write channel closed


    and the node Manager log shows:


    WARNING: Eception exception in Server handlerjava.io.IOException: Bad property data format
    java.io.IOException: data format of Bad properties
    at weblogic.nodemanager.common.DataFormat.readProperties(DataFormat.java:44)
    at weblogic.nodemanager.server.Handler.handleStart(Handler.java:537)
    at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
    at weblogic.nodemanager.server.Handler.run(Handler.java:70)
    at java.lang.Thread.run(Thread.java:619)




    And if I try it in offline mode



    WLS: / offline > startServer ('AdminServer', 'ClassicDomain','t3: / / 10.110.90.156:7002', 'weblogic', 'passwd <>', ' / u0/app/oracle/product/middleware/user_projects/domains ');


    I'm a big pile below. Can anyone with an idea?


    Thank you

    Anatoliy

    Battery in offline mode:

    From weblogic server...
    WLST-WLS-1273604718586: May 11, 2010 21:05:19 CEST > < Info > < WebLogicServer > < BEA-000377 > < start WebLogic Server with BEA JRockit (R) Version R27.6.5-32_o-121899-1.6.0_14-20091001-2113-linux-ia32 of BEA Systems, Inc. >
    WLST-WLS-1273604718586: May 11, 2010 21:05:20 CEST > < Info > < management > < BEA-140013 > < not found /u0/app/oracle/product/middleware/user_projects/domains/config/config.xml >
    WLST-WLS-1273604718586: May 11, 2010 21:05:20 CEST > < Info > < management > < BEA-141254 > < directory of field generation in/u0/app/oracle/product/middleware/user_projects/domains >
    ... WLST-WLS-1273604718586: May 11, 2010 21:05:27 CEST > < critical > < WebLogicServer > < BEA-000362 > < server failed. Reason:
    WLST-WLS-1273604718586:
    WLST-WLS-1273604718586: there are 1 nested errors:
    WLST-WLS-1273604718586:
    WLST-WLS-1273604718586: weblogic.management.ManagementException: failed to create in the domain
    WLST-WLS-1273604718586: to weblogic.management.internal.DomainDirectoryService.generateDomain(DomainDirectoryService.java:229)
    WLST-WLS-1273604718586: to weblogic.management.internal.DomainDirectoryService.ensureDomainExists(DomainDirectoryService.java:152)
    WLST-WLS-1273604718586: to weblogic.management.internal.DomainDirectoryService.start(DomainDirectoryService.java:72)
    WLST-WLS-1273604718586: to weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:461)
    WLST-WLS-1273604718586: to weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:166)
    WLST-WLS-1273604718586: to weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:749)
    WLST-WLS-1273604718586: to weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:488)
    WLST-WLS-1273604718586: to weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:446)
    WLST-WLS-1273604718586: in weblogic. Server.main (Server.Java:67)
    WLST-WLS-1273604718586: due: com.bea.plateng.domain.script.ScriptException: the location of domain must have the write permission.
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptExecutor.writeDomain(ScriptExecutor.java:723)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptParserClassic$ StateMachine.processWrite (ScriptParserClassic.java:575)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptParserClassic$ StateMachine.execute (ScriptParserClassic.java:431)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptParserClassic.parseAndRun(ScriptParserClassic.java:150)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptParserClassic.doExecute(ScriptParserClassic.java:112)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.script.ScriptParser.execute(ScriptParser.java:73)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.DomainInfoHelper.executeSilentScript(DomainInfoHelper.java:858)
    WLST-WLS-1273604718586: to com.bea.plateng.domain.DomainInfoHelper.createDefaultDomain(DomainInfoHelper.java:1762)
    WLST-WLS-1273604718586: at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    WLST-WLS-1273604718586: to sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    WLST-WLS-1273604718586: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    WLST-WLS-1273604718586: to java.lang.reflect.Method.invoke(Method.java:597)
    WLST-WLS-1273604718586: to weblogic.management.internal.DomainDirectoryService.generateDomain(DomainDirectoryService.java:224)
    WLST-WLS-1273604718586:... 8 more
    WLST-WLS-1273604718586:
    WLST-WLS-1273604718586: >
    WLST-WLS-1273604718586: May 11, 2010 21:05:27 CEST > < opinion > < WebLogicServer > < BEA-000365 > < changed failed State Server >
    WLST-WLS-1273604718586: May 11, 2010 21:05:27 CEST > < error > < WebLogicServer > < BEA-000383 > < is not an essential service. The server will shut down >
    WLST-WLS-1273604718586: May 11, 2010 21:05:27 CEST > < opinion > < WebLogicServer > < BEA-000365 > < server status changed to FORCE_SHUTTING_DOWN >
    WLST-WLS-1273604718586: stopped draining WLST-WLS-1273604718586
    WLST-WLS-1273604718586: stopped draining WLST-WLS-1273604718586... Could not connect to the server to check that he has begun. The error returned is: javax.naming.CommunicationException [root exception is java.net.ConnectException: t3://10.110.90.156:7002: Destination unreachable; nested exception is:]
    java.net.ConnectException: connection refused. No router available to destination] Traceback (innermost last):
    Folder "system <>", line 1, in?
    File '< iostream >", line 432 in startServer
    File '< iostream >", line 618, in raiseWLSTException
    WLSTException: An error occurred when executing startServer: could not start the server, the process may have expired or there is an error in the server startup. Please see the logs for more details.

    Have you checked if you have a boot.properties file in this location:
    folder/U0/app/oracle/product/middleware/user_projects/Domains/ClassicDomain/Servers/adminserver/Data/nodemanager?

    If this isn't the case, create a text file called boot.properties with the contents:

    username =
    password =

    Check if it solves your problem

  • ADF InputFile java.io.IOException during download

    Hello

    I want to develop a download using JDev 10 with ADF Faces. To this end, I add after my web.xml:
    <context-param>
        <!-- Maximum memory per request (in bytes) -->
        <param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY</param-name>
        <!-- Use 5MB -->
        <param-value>5242880</param-value>
    </context-param>
    <context-param>
        <!-- Maximum disk space per request (in bytes) -->
        <param-name>oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE</param-name>
        <!-- Use 10MB -->
        <param-value>10485760</param-value>
    </context-param>
    <context-param>
        <!-- directory to store temporary files -->
        <param-name>oracle.adf.view.faces.UPLOAD_TEMP_DIR</param-name>
        <!-- Use an ADFUploads subdirectory of /tmp -->
        <param-value>/tmp/ADFUploads/</param-value>
    </context-param>
    In addition, I have a < af:inputFile > element with a valueChangeListener. If I press the button of my upload, I performs an action, which becomes the InputStream of a the UploadedFile of the file input element.

    However, due to the setting that I put in the web.xml file, I can not download files more than 5 MB. Everything works normally, but if I try to download a larger file, I get this exception:
    500 Internal Server Error
    
    java.io.IOException: The system cannot find the path specified
            at java.io.WinNTFileSystem.createFileExclusively(Native Method)
         at java.io.File.checkAndCreate(File.java:1345)
         at java.io.File.createTempFile(File.java:1434)
         at oracle.adfinternal.view.faces.webapp.UploadedFileImpl._createOutputStream(UploadedFileImpl.java:257)
         at oracle.adfinternal.view.faces.webapp.UploadedFileImpl.loadFile(UploadedFileImpl.java:190)
         at oracle.adfinternal.view.faces.webapp.UploadedFileProcessorImpl.processFile(UploadedFileProcessorImpl.java:92)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doUploadFile(AdfFacesFilterImpl.java:244)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:164)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:595)
    Is it possible to catch the exception and print a normal error message? I want to check the file size before he was transferred, but I don't know how.

    Concerning

    Majo

    The exception below,

    >

    500 Internal Server Error
    
    java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
         at java.io.File.checkAndCreate(File.java:1345)
         at java.io.File.createTempFile(File.java:1434)
    

    >

    My guess is that if the file size is more than 5 MB, it tries to store in the specified temporary disk space ' / tmp/ADFUploads /' and this directory does not exist. Can you make sure that this directory exists and try... ?

    To check the size of the file, you can use uploadedFile.getLength () which returns the size of the file in bytes.

    To catch this exception, you might have try catch around the code where you get the inputstream of the file and process the stream and in the catch block, add FacesMessage error and the value facesContext.

    Kind regards
    ~ Ahmed

  • Error when running a page in J Developer - java.io.IOException: C:\JDeveloper10g\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\server.xml

    Hello

    In J Developer a strange error happens when I try to run any page yesterday.

    I don't know what happened and how do I fix this

    Can someone please help me what to do?

    Screenshot below shows the dialog box when opening the developer J (10.1.3.3)

    Capture.PNG

    Here is the error when running a page,

    java.io.IOException: C:\JDeveloper10g\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\server.xml

    at oracle.jdeveloper.xml.DomIO.loadImpl(DomIO.java:128)

    at oracle.jdeveloper.xml.URLDomIO.load(URLDomIO.java:21)

    at oracle.jdeveloper.xml.BindingIO.load(BindingIO.java:43)

    at oracle.jdeveloper.xml.BindingIO.load(BindingIO.java:37)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getServerConf(Oc4jConfigAdmin.java:227)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getRmiServerURL(Oc4jConfigAdmin.java:978)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getRmiServer(Oc4jConfigAdmin.java:1002)

    at oracle.jdevimpl.runner.oc4j.Oc4jZombieUtil.okToProceed(Oc4jZombieUtil.java:38)

    at oracle.jdevimpl.runner.oc4j.Oc4jStarter.preStart(Oc4jStarter.java:614)

    at oracle.jdevimpl.runner.oc4j.Oc4jStarter.start(Oc4jStarter.java:269)

    at oracle.ide.runner.RunProcess.startTarget(RunProcess.java:830)

    at oracle.jdeveloper.runner.JRunProcess.startTarget(JRunProcess.java:473)

    at oracle.jdevimpl.runner.run.RunningProcess.startTarget(RunningProcess.java:76)

    to oracle.ide.runner.RunProcess$ $2 1.run(RunProcess.java:768)

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)

    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Caused by: oracle.xml.parser.v2.XMLParseException: start of the element root waited.

    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)

    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:341)

    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)

    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:292)

    at oracle.jdeveloper.xml.DomIO.loadImpl(DomIO.java:115)

    ... more than 20

    java.io.IOException: C:\JDeveloper10g\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\server.xml

    at oracle.jdeveloper.xml.DomIO.loadImpl(DomIO.java:128)

    at oracle.jdeveloper.xml.URLDomIO.load(URLDomIO.java:21)

    at oracle.jdeveloper.xml.BindingIO.load(BindingIO.java:43)

    at oracle.jdeveloper.xml.BindingIO.load(BindingIO.java:37)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getServerConf(Oc4jConfigAdmin.java:227)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getHttpWebSiteConf(Oc4jConfigAdmin.java:359)

    at oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin.getHttpPort(Oc4jConfigAdmin.java:1125)

    at oracle.jdevimpl.runner.oc4j.Oc4jPortConflictUtil.acquirePorts(Oc4jPortConflictUtil.java:58)

    at oracle.jdevimpl.runner.oc4j.Oc4jStarter.preStart(Oc4jStarter.java:622)

    at oracle.jdevimpl.runner.oc4j.Oc4jStarter.start(Oc4jStarter.java:269)

    at oracle.ide.runner.RunProcess.startTarget(RunProcess.java:830)

    at oracle.jdeveloper.runner.JRunProcess.startTarget(JRunProcess.java:473)

    at oracle.jdevimpl.runner.run.RunningProcess.startTarget(RunningProcess.java:76)

    to oracle.ide.runner.RunProcess$ $2 1.run(RunProcess.java:768)

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)

    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Caused by: oracle.xml.parser.v2.XMLParseException: start of the element root waited.

    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)

    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:341)

    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)

    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:292)

    at oracle.jdeveloper.xml.DomIO.loadImpl(DomIO.java:115)

    ... more than 20

    I guess BC4J Server is not running.

    Please help me.

    Had to extract the patch again and run the new developer,

    Old data of projects migrated to this new folder, then it is running

  • Why doesn't Java Deployment Toolkit (click-to-play) is blocked, as the referenced bug is closed and there is no security problem not known in Version 7 U51?

    In my view, it is important to block insecure addons. But if you do it should be an open bug assigened. The bug referenced to this add-on is already resolved, so I do not know why this plugin is disabled. https://Bugzilla.Mozilla.org/show_bug.cgi?id=636633

    I have the problem that I want to use Secure_Auth that uses the Deployment Kit Java of nasty (via javascript) way that firefox does not see the deployment kit must be started. This is why I have not expected this plugin still for this web site. Since there is no available documentation how to do this configuration in a config file that I'm stuck at the moment.

    I'm a little surprised liitle which blocks all versions (same secure versions) is a way to get a good user experience.

    Concerning

    Martin

    MG_DAU,

    Why do you think that the problem is caused by the block of Java Deployment Toolkit, not Java itself? See http://www.java.com/en/download/faq/deployment_toolkit.xml and this document I found with a google search:

    For general information on the use of Java on trusted sites, see:

  • Post HTTP and XML DB?

    Hello

    Can I make a post HTTP of a document XML directly to the XML DB basically? Or I have to use a servlet as a listener.

    Thanks in advance!

    Here is an example of using a Servlet to handle a PUT option

    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/oracle as sysdba
    Connected.
    SQL> --
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> def USERNAME = SERVLET
    SQL> --
    SQL> def PASSWORD = &USERNAME
    SQL> --
    SQL> -- def XMLDIR = &1
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user SERVLET cascade
    
    User dropped.
    
    Elapsed: 00:00:00.29
    SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
    new   1: grant create any directory, drop any directory, connect, resource, alter session, create view to SERVLET identified by SERVLET
    
    Grant succeeded.
    
    Elapsed: 00:00:00.03
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user SERVLET default tablespace USERS temporary tablespace TEMP
    
    User altered.
    
    Elapsed: 00:00:00.01
    SQL> /*
    SQL> **
    SQL> ** 11.1.x only
    SQL> **
    SQL> ** call DBMS_XDB.DELETESERVLET(NAME => 'sample')
    SQL> ** /
    SQL> ** call DBMS_XDB.DELETESERVLETMAPPING(NAME => 'sample')
    SQL> ** /
    SQL> ** call DBMS_XDB.DELETESERVLETSECROLE(SERVNAME     => 'sample', ROLENAME  => 'anonymousServletRole' )
    SQL> ** /
    SQL> ** call DBMS_XDB.ADDSERVLETMAPPING(PATTERN => '/sys/servlets/&USERNAME/sample/*', NAME => 'sample')
    SQL> ** /
    SQL> ** call DBMS_XDB.ADDSERVLET
    SQL> ** (
    SQL> **         NAME     => 'sample',
    SQL> **         LANGUAGE => 'Java',
    SQL> **         DISPNAME => 'Sample Servlet',
    SQL> **         DESCRIPT => 'Sample Servlet',
    SQL> **         SCHEMA   => '&USERNAME',
    SQL> **         CLASS    => 'com.oracle.st.xdb.pm.examples.servlets.SampleServlet'
    SQL> ** )
    SQL> ** /
    SQL> ** call DBMS_XDB.ADDSERVLETSECROLE
    SQL> ** (
    SQL> **    SERVNAME     => 'sample',
    SQL> **    ROLENAME     => 'anonymousServletRole',
    SQL> **    ROLELINK     => 'anonymousServletRole'
    SQL> ** )
    SQL> ** /
    SQL> **
    SQL> */
    SQL> call xdb_configuration.addServletMapping
      2       (
      3         '/sys/servlets/&USERNAME/sample/*',
      4         'Sample Servlet',
      5         'Sample Servlet',
      6         'com.oracle.st.xdb.pm.examples.servlets.SampleServlet',
      7         '&USERNAME',
      8         'Java',
      9         null,
     10         xmltype('anonymousServletRoleanonymousServletRole
     11       )
     12  /
    old   3:        '/sys/servlets/&USERNAME/sample/*',
    new   3:        '/sys/servlets/SERVLET/sample/*',
    old   7:        '&USERNAME',
    new   7:        'SERVLET',
    
    Call completed.
    
    Elapsed: 00:00:00.09
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> VAR JAVA_SOURCE       CLOB
    SQL> VAR JAVA_SOURCE_PATH  VARCHAR2(700);
    SQL> --
    SQL> begin
      2    :JAVA_SOURCE_PATH := '/public/SampleServlet.java';
      3          :JAVA_SOURCE :=
      4  'package com.oracle.st.xdb.pm.examples.servlets;
      5
      6  import java.io.IOException;
      7  import java.io.OutputStreamWriter;
      8  import java.io.Reader;
      9  import java.io.StringReader;
     10  import java.io.Writer;
     11  import java.sql.DriverManager;
     12  import java.sql.PreparedStatement;
     13  import java.sql.SQLException;
     14
     15  import javax.servlet.ServletException;
     16  import javax.servlet.http.HttpServlet;
     17  import javax.servlet.http.HttpServletRequest;
     18  import javax.servlet.http.HttpServletResponse;
     19
     20  import oracle.jdbc.OracleConnection;
     21  import oracle.jdbc.OracleDriver;
     22
     23  import oracle.jdbc.OraclePreparedStatement;
     24
     25  import oracle.sql.CLOB;
     26
     27  import oracle.xdb.XMLType;
     28
     29  public class SampleServlet extends HttpServlet {
     30
     31      private OracleConnection dbConnection;
     32
     33      public SampleServlet() {
     34      }
     35
     36      private void initializeDatabaseConnection() throws SQLException {
     37          DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
     38          OracleDriver ora = new OracleDriver();
     39          this.dbConnection = (OracleConnection) ora.defaultConnection();
     40      }
     41
     42      public void doGet(HttpServletRequest request, HttpServletResponse response)
     43      throws ServletException, IOException
     44      {
     45          try {
     46            response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
     47          }
     48          catch (Exception e) {
     49            System.out.println("SampleServlet.doGet() : Caught Exception.");
     50            e.printStackTrace(System.out);
     51            System.out.flush();
     52            try {
     53              this.dbConnection.rollback();
     54            }
     55            catch (SQLException sql) {
     56              System.out.println("SampleServlet.doGet() : Rollback Exception.");
     57              sql.printStackTrace(System.out);
     58              System.out.flush();
     59            }
     60            finally {
     61              response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
     62              e.printStackTrace(System.out);
     63              System.out.flush();
     64           }
     65         }
     66      }
     67
     68      public Reader doPutImpl(HttpServletRequest request, HttpServletResponse response)
     69      throws SQLException, IOException {
     70
     71          OraclePreparedStatement statement =  (OraclePreparedStatement) this.dbConnection.prepareStatement("insert into MY_XML_TABLE values (:
     72          XMLType myXML = new XMLType(dbConnection,request.getInputStream());
     73          statement.setObject(1, myXML);
     74          statement.execute();
     75          statement.close();
     76
     77          String responseText = "Upload Complete
    Successfully uploaded document into MY_XML_TABLE declare 2 V_RESULT BOOLEAN; 3 begin 4 if (DBMS_XDB.existsResource(:JAVA_SOURCE_PATH)) then 5 DBMS_XDB.deleteResource(:JAVA_SOURCE_PATH); 6 end if; 7 V_RESULT := DBMS_XDB.createResource(:JAVA_SOURCE_PATH,:JAVA_SOURCE); 8 end; 9 / PL/SQL procedure successfully completed. Elapsed: 00:00:00.04 SQL> -- SQL> undef JAVA_SOURCE_PATH SQL> -- SQL> column JAVA_SOURCE_PATH new_value JAVA_SOURCE_PATH SQL> -- SQL> select :JAVA_SOURCE_PATH JAVA_SOURCE_PATH from dual 2 / JAVA_SOURCE_PATH -------------------------------------------------------------------------------- /public/SampleServlet.java Elapsed: 00:00:00.01 SQL> def JAVA_NAME = SampleServlet SQL> def JAVA_SOURCE_PATH DEFINE JAVA_SOURCE_PATH = "/public/SampleServlet.java" (CHAR) SQL> -- SQL> create or replace and resolve java source 2 named "&JAVA_NAME" 3 using CLOB (select xdburitype('&JAVA_SOURCE_PATH').getClob() from dual); 4 / old 2: named "&JAVA_NAME" new 2: named "SampleServlet" old 3: using CLOB (select xdburitype('&JAVA_SOURCE_PATH').getClob() from dual); new 3: using CLOB (select xdburitype('/public/SampleServlet.java').getClob() from dual); Java created. Elapsed: 00:00:00.56 SQL> show errors No errors. SQL> -- SQL> declare 2 shortname varchar2(128); 3 begin 4 select dbms_java.shortname(NAME) 5 into shortname 6 from USER_JAVA_CLASSES 7 where SOURCE = '&JAVA_NAME'; 8 execute immediate 'grant execute on "' || shortname || '" to public'; 9 end; 10 / old 7: where SOURCE = '&JAVA_NAME'; new 7: where SOURCE = 'SampleServlet'; PL/SQL procedure successfully completed. Elapsed: 00:00:00.06 SQL> create table MY_XML_TABLE of XMLTYPE 2 / Table created. Elapsed: 00:00:00.06 SQL> select * 2 from MY_XML_TABLE 3 / no rows selected Elapsed: 00:00:00.01 SQL> VAR RESPONSE VARCHAR2(4000) SQL> -- SQL> DEF HOSTNAME = ORA10200 SQL> -- SQL> DECLARE 2 V_SERVLET_URL VARCHAR2(4000) := 'http://&USERNAME:&PASSWORD@&HOSTNAME/sys/servlets/&USERNAME/sample/upload.xml'; 3 V_MESSAGE VARCHAR2(4000) := 'World'; 4 V_REQUEST UTL_HTTP.REQ; 5 V_RESPONSE UTL_HTTP.RESP; 6 V_BUFFER VARCHAR2(32000); 7 V_RESPONSE_TEXT CLOB; 8 V_RESPONSE_XML XMLTYPE; 9 V_WSDL XMLTYPE; 10 BEGIN 11 DBMS_LOB.CREATETEMPORARY(V_RESPONSE_TEXT, TRUE); 12 13 begin 14 V_REQUEST := UTL_HTTP.BEGIN_REQUEST(URL => V_SERVLET_URL, METHOD => 'PUT'); 15 -- UTL_HTTP.SET_AUTHENTICATION(V_REQUEST, '&USERNAME', '&PASSWORD' ); 16 UTL_HTTP.SET_HEADER(V_REQUEST, 'User-Agent', 'Mozilla/4.0'); 17 UTL_HTTP.SET_HEADER (R => V_REQUEST, NAME => 'Content-Length', VALUE => LENGTH(V_MESSAGE)); 18 UTL_HTTP.WRITE_TEXT (R => V_REQUEST, DATA => V_MESSAGE); 19 V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST); 20 LOOP 21 UTL_HTTP.READ_LINE(V_RESPONSE, V_BUFFER, TRUE); 22 if (LENGTH(V_BUFFER) > 0) then 23 DBMS_LOB.WRITEAPPEND(V_RESPONSE_TEXT,LENGTH(V_BUFFER),V_BUFFER); 24 end if; 25 END LOOP; 26 UTL_HTTP.END_RESPONSE(V_RESPONSE); 27 EXCEPTION 28 WHEN UTL_HTTP.END_OF_BODY THEN 29 UTL_HTTP.END_RESPONSE(V_RESPONSE); 30 END; 31 32 :RESPONSE := V_RESPONSE_TEXT; 33 34 DBMS_LOB.FREETEMPORARY(V_RESPONSE_TEXT); 35 36 END; 37 / old 2: V_SERVLET_URL VARCHAR2(4000) := 'http://&USERNAME:&PASSWORD@&HOSTNAME/sys/servlets/&USERNAME/sample/upload.xml'; new 2: V_SERVLET_URL VARCHAR2(4000) := 'http://SERVLET:SERVLET@ORA10200/sys/servlets/SERVLET/sample/upload.xml'; old 15: -- UTL_HTTP.SET_AUTHENTICATION(V_REQUEST, '&USERNAME', '&PASSWORD' ); new 15: -- UTL_HTTP.SET_AUTHENTICATION(V_REQUEST, 'SERVLET', 'SERVLET' ); PL/SQL procedure successfully completed. Elapsed: 00:00:00.62 SQL> set long 100000 SQL> -- SQL> select :RESPONSE 2 from dual 3 / :RESPONSE -------------------------------------------------------------------------------- Upload Complete
    Successfully uploade d document into MY_XML_TABLE
    Elapsed: 00:00:00.01 SQL> select * 2 from MY_XML_TABLE 3 / SYS_NC_ROWINFO$ -------------------------------------------------------------------------------- World Elapsed: 00:00:00.00 SQL>
  • tabs will close In addition, they duplicate; I closed and restarted; several tabs open in double

    Tabs will not close. I click on the close box and Ctrl/W and Firefox jumps to the next tab, but the tabs are open. Not only that, they duplicate. I tried several times to close tabs, and have several copies of each step open - more than 50 tablets. I closed and reopened Firefox and they all open again. How can I get them to close.

    This has happened

    Each time Firefox opened

    is a few days; no known cases of othe

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of your modules is causing your problem (switch to the DEFAULT theme: Tools > Modules > themes).
    See the extensions, themes and problems of hardware acceleration to resolve common troubleshooting Firefox problems and troubleshooting questions with plugins like Flash or Java to solve common Firefox problems

    If this does not work in safe mode and then disable all your extensions and then try to find out who is causing by allowing both the problem reappears.
    You can use 'Disable all add-ons' on the start safe mode window.
    You will need to close and restart Firefox after each change through "file > exit" (on Mac: "Firefox > Quit")

    Also check the start-up and the homepage layout.
    Firefox > Preferences > General > startup

  • When I play in pogo games, that a message appears as a fatal error with java runtime tried several tips and can't resolne the problem

    a fatal error occurs in java runtime when you play the game by pogo

    Hello

    1. did you work before?

    2. don't you make changes to the computer until the problem occurred?

    3. could you give us the exact error message?

    4. you try to play online?

    5. This only happens when you try to play Pogo games?

    If you receive the same error in IE, then I suggest you follow the steps from the link below.

    Correct errors in Internet Explorer:

    http://support.Microsoft.com/kb/822521

    You can also check this link for help:

    How do I manually download and install Java for my Windows computer?
    http://Java.com/en/download/help/windows_manual_download.XML

    Try working through the steps provided here to resolve the error you receive everything by trying to play Pogo games:
    Java - how to solve some problems running Pogo games?

    Hope this information is useful.

  • java.io.IOException: APN is not specified

    Hello

    I saw that this topic was opened at other times, but I don't know if I understand what I have to do.

    First of all, I got this code:

    String url1 = "www.myurl.com;

    con = (HttpConnection), Connector.open (url1).

    is = con.openInputStream ();

    But when I try it in my BB device, I got java.io.IOException: APN is not specified. (Try the code with the blackberry MDS services simmulators email in the works of eclipse Simulator)

    So, as I read somewhere there, I tried this code:

    TransportDetective td =new TransportDetective();

    if ( TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_BIS_B) | TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_MDS) | TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_TCP_CELLULAR) | TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_TCP_WIFI) | TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_WAP) | TransportDetective.isCoverageAvailable (TransportDetective. TRANSPORT_WAP2))

    {

    String url2 = 'www.myurl.com;

    URLFactory urlFactory =new URLFactory(url2);

    final ServiceRecord defaultTCPSR = td.getDefaultTcpCellularServiceRecord ();

    final String connectionURL = urlFactory.getHttpDefaultTcpCellularUrl (defaultTCPSR);

    HttpConnection conn = (HttpConnection), Connector.open (connectionURL);

    }

    But when I paste in my code, I wonder to create classes of URLFactory and also TransportDetective.

    I looked on the net and I found codes for the class here: http://ecuadorblackberry.ec/?p=425

    But when I try, I get that td.getDefaultTcpCellularServiceRecord () returns a null value, so it does not work.

    The only thing I want, is to connect to a web service from my application, how can I do?

    Thank you

    Sorry one thing yet.

    You have discovered, you can specify the options of AFN directly on the URL.

    Because you are in Spain and will sell to people in Spain only, then you can check the network and provide the correct APN information for this network.  Watch RadioInfo.  You can use

    getCurrentNetworkName()

    and try to match the name, or

    getMNC (RadioInfo.getCurrentNetworkIndex ())

    and look for the associated MNC code and match from there.

    Once you know the network, you can specify the AFN on the URL.

    Who help me?

  • Consume Webservice - java.io.IOException: General socket error

    Hey,.

    I'm trying to consume a webservice ( www.webservicex.net, but also tried other forecasts) with a smart blackberry phone, but I still have a java.io.IOException.

    I generated stubs with the Java Wireless Toolkit 2.5.2. Now, I call the heel of the Java application.

    My MDS is running and are configured for use with my proxy. I can view each page with the built-in browser.

    The call of the stub works like this:

    public class BB_WeatherStart extends MainScreen {
    
       public BB_WeatherStart() throws RemoteException {
        com.weather.WeatherForecasts weather = null;
        WeatherForecastSoap_Stub stub = new WeatherForecastSoap_Stub();
        weather = stub.getWeatherByZipCode("10024");
    
        LabelField longi = new LabelField();
        longi.setText("Longitüde" + weather.getLongitude());
        add(longi);
    
        LabelField status = new LabelField();
        status.setText("Status" + weather.getStatus());
        add(status);
       }
    
    }
    

    The instantiation of the stub works, but the call of the method getWeatherByZipCode returns this exception.

    This is the code for the method:

    public com.weather.WeatherForecasts getWeatherByZipCode(java.lang.String zipCode) throws java.rmi.RemoteException {
    
       Object[] inputObject = new Object[1];
       inputObject[0] = zipCode;
    
       Operation op = Operation.newInstance(_qname_GetWeatherByZipCode, _type_GetWeatherByZipCode, _type_GetWeatherByZipCodeResponse);
       _prepOperation(op);
       op.setProperty(Operation.SOAPACTION_URI_PROPERTY, "http://209.162.186.60/GetWeatherByZipCode;deviceSide=true");
    
       Object resultObj;
       try {
          resultObj = op.invoke(inputObject);
       } catch (JAXRPCException e) {
        throw e;
       }
    
    //Snip.. the Rest of the method is never reached ;)
    
    }
    

    The Exception is thrown in the call to op.invoke (inputObject);

    I also tried the hostname instead of IP address, but then I get a j "" ava.io.IOException: bad DNS address "and if I try without the"; " deviceSide = true' I get the message "Local port: 19780 APN:"rim.net.gprs"APN username: password 'null' AFN: there is no connection"null"

    Thanks for your help

    Tina

    After watching a little I don't think that the original problem was with the connection I think it is related to a null value returned by the web service.  I generated a set of stubs from the web service, you were using and tried with the same result as you.  I got a version of 4.5 and made some settings (I don't specifically know who he was) and the error has become ' java.rmi.MarshalException: nillable not element of array in response type is not met. ".  Went up to version 4.7 and here it works very well.  If you run this with a test tool web service call, you see a null of WeatherData to the bottom element which is the likely culprit.  I read somewhere that BB do not have NULL values in some earlier versions.

    hope that helps.

    T

  • Java.io.ioException: Tunnel Timed out received

    Hello

    We have developed a Java ME application that has been evaluated for fine fonctinner on Blackberry 9000 using the Wifi Interface. Downloaded the application on our server and the application installed on the device using OTA. The cod was signed through Blackberry. Application installs correctly and when it is launched, he's trying to connect to our server by using the HTTP connection. We use the direct TCP with Vodafone (India) APN setting (I tried www, portalnmms and blackberry.net) but with all 3 APNs, the error is the same:

    java.io.IOException: Tunnel Timed Out

    With the URL '; deviceside = true' is specified for a direct TCP connection. Default browser to HTTP is configured for the Internet browser.

    HTTPDemo installed JDE, device samples and it also gives the same error.

    Tried to contact the service provider for the mistake of tunnel... but no help.

    Can someone help pls on this issue? Are there network tools to diagnose problems of tunnel on blackberry?

    Model: Blackberry 8310

    Version: 4.5.0.55 (Platform 2.7.0.68)

    Thank you

    Bennett

    Try the NetworkDiagnostics tool of the RIM. In addition, look at the log of events to see if the right NPP (those that you set in the Options-> advanced-> TCP) is actually used by the operating system - sometimes WAP 2.0 TCP is used instead.

    Another thing you could try is to take the this BlackBerry SIM card and insert it in a non-BlackBerry phone, say, a Nokia. Then you can check if this unit can connect to the Internet and you might also find what NPC he uses.

  • Problem with HttpConnection when it connects only not to wifi - java.io.IOException: Tunnel failed

    Hi all

    I develop an application that communicates with a database MySQL via PHP stored on the server scripts. Until today I've developed using the Simulator, and everything has been fine. I now started to test on a device and, while being connected to wifi, everything is still fine. However, the minute I turn off wifi and let the network provider, O2 UK, I get:

    "Request failed: reason: java.io.IOException: Tunnel failed".

    The source of the connection code is as follows:

       public void run() {
           // The following code will only build under JDE 4.5 and later
    
           try {
               String connectionParameters = "";
               // JDE 4.3 is required to get WLANInfo
               if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                   // Connected to a WiFi access point
                   connectionParameters = ";interface=wifi";
               } else {
                   int coverageStatus = CoverageInfo.getCoverageStatus();
                   ServiceRecord record = getWAP2ServiceRecord();
                   if (record != null
                           // In JDE 4.5 CoverageInfo changed the name of
    COVERAGE_CARRIER to COVERAGE_DIRECT
                           // The constant value for both is the same,
    '1', so you can use that to avoid any
                           // dependency on JDE 4.5
                           && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage and a WAP 2.0 service book record
                       connectionParameters = ";deviceside=true;ConnectionUID="
                               + record.getUid();
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) ==
                           CoverageInfo.COVERAGE_MDS) {
                       // Have an MDS service book and network coverage
                       connectionParameters = ";deviceside=false";
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage but no WAP 2.0 service book record
                       connectionParameters = ";deviceside=true";
                   }
               }
    
               // Pop up a dialog showing the parameters chosen
               UiApplication.getUiApplication().invokeLater(
                       new DialogRunner("Connection Params: "
                               + connectionParameters));
    
               HttpConnection connection = (HttpConnection) Connector.open(url
                       + connectionParameters);
    
               connection.setRequestMethod(method);
               if (method.equals("POST") && postData != null) {
                   connection.setRequestProperty("Content-type",
                           "application/x-www-form-urlencoded");
                   OutputStream requestOutput = connection.openOutputStream();
                   requestOutput.write(postData);
                   requestOutput.close();
               }
               int responseCode = connection.getResponseCode();
               if (connection instanceof HttpsConnection) {
                   HttpsConnection secureConnection = (HttpsConnection) connection;
                   String issuer = secureConnection.getSecurityInfo()
                           .getServerCertificate().getIssuer();
                   UiApplication.getUiApplication().invokeLater(new
    DialogRunner("Secure Connection! Certificate issued by: " + issuer));
    
               }
               // Really you should check for more than just HTTP_OK
               if (responseCode != HttpConnection.HTTP_OK) {
                   screen.requestFailed("Unexpected response code: "
                           + responseCode);
                   connection.close();
                   return;
               }
    
               String contentType = connection.getHeaderField("Content-type");
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
    
               InputStream responseData = connection.openInputStream();
               byte[] buffer = new byte[10000];
               int bytesRead = responseData.read(buffer);
               while (bytesRead > 0) {
                   baos.write(buffer, 0, bytesRead);
                   bytesRead = responseData.read(buffer);
               }
               baos.close();
               connection.close();
    
               screen.requestSucceeded(baos.toByteArray(), contentType);
           } catch (IOException ex) {
               screen.requestFailed(ex.toString());
           }
       }
    

    I scoured these forums and tried everything I can find. I tried different settings, including changing the APN settings both wap and mobile options for O2. Nothing seems to solve this problem.

    Any help would be appreciated!

    Thank you

    Jack

    OK, good news. Fixed. Thanks a lot for your answers. I would have understood the connection settings as they appear to have been the problem.

    I don't remember exactly which it generated, but I decided to try replacing it with the generator of connectionParameter above with the snippet connSuffix here:
    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

    Worked like a dream, so I'm very indebted to all those who contributed to this. It now seems to work little matter the type of connection is available including BES.

    In case anyone is interested, however, I tried all combinations of settings APN bloody O2, but it came to nothing. I am disappointed that it was the connection settings I developed that a book by Apress, and I followed this particular part, Word for Word.

    Thank you all for the world of useful information here!

  • java.io.IOException: null for setRequestMethod ("POST") of HttpConnection

    Hello

    I m opening HttpConnection with

    HttpConnection connection = null;
    
    try
    {
        connection = (HttpConnection)Connector.open(targetURL);
        int status = connection.getResponseCode();
        System.out.println("status is : " + status);
    
        if (status == HttpConnection.HTTP_OK)
        {
           System.out.println("HttpConnection.HTTP_OK : "+connection.getResponseMessage());
           connection.setRequestMethod("POST");
           //connection.setRequestMethod(HttpConnection.POST);
           System.out.println("connection.setRequestMethod(POST);
           /*connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
           connection.setRequestProperty("Content-Language", "en-US");
    
           //Send request
           wr = new DataOutputStream(connection.openOutputStream());
                         wr.writeChars(sendRequest);
                         wr.flush();
                         wr.close
           }
    }
    catch (IOException e)
    {
        System.err.println("ERROR =====> " + e.toString()+":: "+e.getMessage());
        e.printStackTrace();
    }
    

    But I m is

    java.io.IOException: null for setRequestMethod("POST")
    

    Until it runs fine.

    What is the problem in my code?

    You do it in the wrong order. You need to do the setRequestMethod(), the setRequestProperty() and the openOutputStream() before calling getResponseCode().

  • java.io.IOException:Tunnel down in a call to url

    Hello

    I wrote a code that use HTTPConnection to call a url:

    HttpConnection conn = (HttpConnection), Connector.open (url);
    conn.setRequestMethod (HttpConnection.GET);
    int respCode = conn.getResponseCode ();
    ...

    It's ok in my Pearl and send the url correct, but on "BOLD" my friend, I caught this exception:
    java.io.IOException:Tunnel Failed

    I also test who call for help

    StreamConnection c = null;
    S InputStream = null;
    try {}
    c = Connector.open (url) (StreamConnection);
    s = c.openInputStream ();
    ...

    and

    ContentConnection c = null;
    DataInputStream tell = null;
    try {}
    c = Connector.open (url) (ContentConnection);
    int len = (int) c.getLength ();
    say = c.openDataInputStream ();
    ...

    but it's the same.

    Also, I can call the url by bb browser and it's ok.
    I tested the app by WIFI and Edge.
    It's really weird

    Thanks in advance

    You must understand the functioning of connections of BB.

    Please look at the sticky thread on communications at the top of this forum.

    BTW, this is a double post on the BB developer forum, where I also answered your question.

  • Curve 8320 java.io.IOException: connection not writable

    Hey guys,.

    Does anyone know of specific problems with the connections involving 8320 to the images? It seems to me this error:

    java.io.IOException: connection not writable

    When I try to upload an image. I know that the code is correct, because I got it runnning on the 8830, 8900, 9000 and 9530.

    Anyone know of a particular way of dealing with that on this version?

    Thanks for your help and your time

    EDIT: It is also worth noting that I have a series of other connections to Web pages using the formats the https and http which work perfectly well with the 8320. It only occurs with the download of images.

    Apparently he has developed before, for example,

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=16200

    You can view the code? At least that anyone happen to know of a bug that would cause this, at least consider a timing

    or weird problem because they may appear only in certain configurations.

Maybe you are looking for

  • 28 Firefox crashes when I try to print to the printer, Acrobat PDF

    Hi all! I observed a problem when I try to print a Web page in Firefox v28 using the printer of PDF Acrobat (Acrobat Pro 9.5.5) installed on a Virtual Machine (VMware View 5.2) with Windows 7 64 bit. Print dialog box crashes (no response) after the p

  • Why does my work Launchd suddenly stop

    10.9.5 OSX MacBook Air 11 inch end 2010 I have a running on this MacBook launchd job. The job runs a shell script every four minutes. This shell script renders an image of the webcam and upload it to my site. Most of the time it works fine. But, ever

  • do not install latest updates

    get this error microsoft.net framework 3.5 service pack 1 and the .net framework 3.5 family update for versions of .net 2.0 to 3.5 (kb951847) x 86

  • Update is under Firewall started

    OK need a little help will try to do that's short and sweet. After years of 5 1/2 of hicups broken registrys etc. I decided to reinstall the XP PRO operating system, first tech has been a disaster, 2nd tech not better, at least 3 knew what he was doi

  • Presario CQ57 laptop: Compaq Presario CQ57 material

    Hello, I wanted to know if I could spend my processor Celeron in my Compaq CQ57 Notebook. In addition, Ram and graphics card can be improved? * I hope this is enough information *. Product name: computer laptop Presario CQ57 Product number: QE264UA #