Deadlock on at java.lang.StringBuffer.expandCapacity?

Hey,
I am getting a serious problem when with one of my webservices calls, I receive a block of xml from the webservice and have to parse it using an provided xsd.
It seems that the soap call returns in a "reasonable" amount of time but the jaxb part seems to take far longer than expected! Actually worse case scenario is that the webserver (SUN Wbsvr 6.1) actually freezes. When I do a kill -3 I get
at java.lang.StringBuffer.expandCapacity(StringBuffer.java:202)
at java.lang.StringBuffer.append(StringBuffer.java:401)
- locked <0x73725580> (a java.lang.StringBuffer)
at com.sun.org.apache.xerces.internal.dom.CharacterDataImpl.appendData(CharacterDataImpl.java:227)
at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.characters(SAX2DOM.java:88)
at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.characters(ToXMLSAXHandler.java:542)
at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:614)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.characters(AbstractSAXParser.java:522)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.handleCharacter(XMLDocumentFragmentScannerImpl.java:1226)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1178)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:341)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:828)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:758)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1178)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:548)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:602)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:83)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:34)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:82)
at com.sun.xml.rpc.client.HandlerChainImpl.checkMustUnderstand(HandlerChainImpl.java:235)
at com.sun.xml.rpc.client.StreamingSender._callResponseHandlers(StreamingSender.java:765)
at com.sun.xml.rpc.client.StreamingSender._preHandlingHook(StreamingSender.java:697)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:103)
at ie.code.webservices.soap.profilemanager.ProfileManagerSoap_Stub.getSubscriberCallDetailsEx(ProfileManagerSoap_Stub.java:611)Any ideas?
Eoin

Thread [main] (Suspended)
     java.lang.StringBuffer.expandCapacity(int) line: 202
     java.lang.StringBuffer.append(java.lang.String) line: 401
     com.sun.xml.messaging.saaj.soap.impl.TextImpl(com.sun.org.apache.xerces.internal.dom.CharacterDataImpl).appendData(java.lang.String) line: not available
     com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.characters(char[], int, int) line: 88
     com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.characters(char[], int, int) line: 542
     com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFilter(org.xml.sax.helpers.XMLFilterImpl).characters(char[], int, int) line: 564
     com.sun.org.apache.xerces.internal.parsers.SAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).characters(com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations) line: not available
     com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanContent() line: not available
     com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: not available
     com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl(com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: not available
     com.sun.org.apache.xerces.internal.parsers.JAXPConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(boolean) line: not available
     com.sun.org.apache.xerces.internal.parsers.JAXPConfiguration(com.sun.org.apache.xerces.internal.parsers.XML11Configuration).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: not available
     com.sun.org.apache.xerces.internal.parsers.SAXParser(com.sun.org.apache.xerces.internal.parsers.XMLParser).parse(com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource) line: not available
     com.sun.org.apache.xerces.internal.parsers.SAXParser(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser).parse(org.xml.sax.InputSource) line: not available
     com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFilter(org.xml.sax.helpers.XMLFilterImpl).parse(org.xml.sax.InputSource) line: 333
     com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(javax.xml.transform.Source, com.sun.org.apache.xml.internal.serializer.SerializationHandler) line: 584
     com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(javax.xml.transform.Source, com.sun.org.apache.xml.internal.serializer.SerializationHandler, java.lang.String) line: 638
     com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(javax.xml.transform.Source, javax.xml.transform.Result) line: 279
     com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(javax.xml.transform.Source, com.sun.xml.messaging.saaj.soap.SOAPPartImpl) line: 97
     com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource() line: 39
     com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl(com.sun.xml.messaging.saaj.soap.SOAPPartImpl).getEnvelope() line: 98
     com.sun.xml.rpc.client.HandlerChainImpl.checkMustUnderstand(javax.xml.rpc.handler.MessageContext) line: 235
     com.ndex.wsdl.configurator.ConfiguratorSoap_Stub(com.sun.xml.rpc.client.StreamingSender)._callResponseHandlers(com.sun.xml.rpc.client.StreamingSenderState) line: 783
     com.ndex.wsdl.configurator.ConfiguratorSoap_Stub(com.sun.xml.rpc.client.StreamingSender)._preHandlingHook(com.sun.xml.rpc.client.StreamingSenderState) line: 715
     com.ndex.wsdl.configurator.ConfiguratorSoap_Stub._preHandlingHook(com.sun.xml.rpc.client.StreamingSenderState) line: 3591
     com.ndex.wsdl.configurator.ConfiguratorSoap_Stub(com.sun.xml.rpc.client.StreamingSender)._send(java.lang.String, com.sun.xml.rpc.client.StreamingSenderState) line: 107
     com.ndex.wsdl.configurator.ConfiguratorSoap_Stub.exportData(java.lang.String, com.ndex.wsdl.configurator.ExportMode, com.ndex.wsdl.configurator.ArrayOfString, com.ndex.wsdl.configurator.ArrayOfString) line: 226
     com.ndex.wsdl.Test.main(java.lang.String[]) line: 130

Similar Messages

  • How is the java.lang.StringBuffer class different from the java.lang.String

    How is the java.lang.StringBuffer class different from the java.lang.String class?....

    Read the API.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
    "Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings."
    Although when possible you should use StringBuilder instead of StringBuffer.
    Always read the API at the very least before asking questions in the forums. Ideally you should do some google searching and poke around for an answer too. Otherwise you will get people barking at you.
    Drake

  • ClassCastException:  java.lang.StringBuffer

    ANy idea what could cause the exception?
    java.lang.ClassCastException: java.lang.StringBuffer
         at java.util.Properties.store(Properties.java:449)
              Properties applicationProps = new Properties();
              // now load properties from last invocation
              FileInputStream in = new FileInputStream("EmailRecord.properties");
              applicationProps.load(in);
              in.close();
              emailRefNo = this.getUniqueID();
              FileOutputStream out = new FileOutputStream("EmailRecord.properties");
              applicationProps.put(emailRefNo,msg);
              applicationProps.store(out, "No Comment");
              out.close();

    Don't use this method: applicationProps.put(emailRefNo,msg);instead use setProperty. One of the many design mistakes that Sun made is to have Properties extend rather than delegate to Hashtable. If you use setProperty, you'll get a compile-time error rather than a runtime exception. I'll assume you know how to fix those. :-)

  • How to solve 'java/lang/OutOfMemoryError' when apply weblogic patch 10.3.6.0.10?

    Hi All:  Our platform is IBM AIX power system 64 bit, os level 6.  Oracle Fusion Middleware version is 10.3.6.0.8.  We tried to patch 10.3.6.0.10 on it, but encounter ‘out of memory error’ when  applied WebLogic patch 10.3.6.0.10 on UAT report server.  Currently UAT has 3GB memory (currently is 3G) .
    JVMDUMP006I Processing dump event "systhrow",
    detail "java/lang/OutOfMemoryError
    JVMDUMP032I JVM requested Heap dump using
    '/ora_bin01/u01/oracle/Middleware/utilhd' in response to an event
    JVMDUMP010I Heap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152727.6422620.0001.phd
    JVMDUMP032I JVM requested Java dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152727.6422620.0002.txt'
    in response to an event
    JVMDUMP010I Java dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152727.6422620.0002.txt
    JVMDUMP032I JVM requested Snap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152727.6422620.0003.trc'
    in response to an event
    JVMDUMP006I Processing dump event "systhrow",
    detail "java/lang/OutOfMemoryError" - please wait.
    JVMDUMP010I Snap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152727.6422620.0003.trc
    JVMDUMP013I Processed dump event "systhrow",
    detail "java/lang/OutOfMemoryError".
    JVMDUMP032I JVM requested Heap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152735.6422620.0004.phd'
    in response to an event
    JVMDUMP010I Heap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152735.6422620.0004.phd
    JVMDUMP032I JVM requested Java dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152735.6422620.0005.txt'
    in response to an event
    JVMDUMP010I Java dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152735.6422620.0005.txt
    JVMDUMP032I JVM requested Snap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152735.6422620.0006.trc'
    in response to an event
    Exception in thread "main"
    java.lang.OutOfMemoryError at
    java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)
    at
    java.lang.StringBuffer.append(StringBuffer.java:201)
    at
    java.lang.Class.throwNoSuchMethodException(Class.java:278)
    at
    java.lang.Class.getMethod(Class.java:845)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.isValueSet(XBeanDataHandler.java:958)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.getValueFromObject(XBeanDataHandler.java:589)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.getSimpleValue(XBeanDataHandler.java:431)
    at
    com.bea.plateng.patch.dao.cat.PatchDependency.getRule(PatchDependency.java:48)
    at
    com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getInvalidatedPatchMap(PatchCatalogHelper.java:1625)
    at com.bea.plateng.patch.PatchSystem.updatePatchCatalog(PatchSystem.java:436)
    at
    com.bea.plateng.patch.PatchSystem.refresh(PatchSystem.java:130)
    at
    com.bea.plateng.patch.PatchSystem.setCacheDir(PatchSystem.java:201)
    at
    com.bea.plateng.patch.Patch.main(Patch.java:281)
    JVMDUMP010I Snap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152735.6422620.0006.trc
    JVMDUMP013I Processed dump event "systhrow",
    detail "java/lang/OutOfMemoryError".
    Exception in thread "Attach API wait loop"
    java.lang.OutOfMemoryError
       at
    com.ibm.tools.attach.javaSE.CommonDirectory.waitSemaphore(CommonDirectory.java:222)
    at
    com.ibm.tools.attach.javaSE.AttachHandler$WaitLoop.waitForNotification(AttachHandler.java:329)
    at com.ibm.tools.attach.javaSE.AttachHandler$WaitLoop.run(AttachHandler.java:396)
    bsu.sh -install -patch_download_dir=/ora_bin01/u01/oracle/Middleware/utils/bsu/cache_dir -patchlist=12UV -prod_dir=/ora_bin01/u01/oracle/Middleware/wlserver_10.3
    we followed the README.txt instructions, and stop/start weblogic service before/after apply patch. Can anyone suggest a solution or Doc ID for helping us?
    thank you very much!

    Solutions: Bounce the applications and check the arguments if you can increase it.  It is due to memory issue
    You can set these values in CommEnv.sh (.cmd for windows) file located in the weblogic_home/common/bin directory.
    This gets applied to all the domains under that wls home.
    If you want to make the changes to specific domain then edit the SetDomainEnv.sh file located under the domain/bin directory.
    How to solve java.lang.OutOfMemoryError: Java heap space
    solutions:  export JVM_ARGS="-Xms1024m -Xmx1024m"
    How to solve java.lang.OutOfMemoryError: PermGen space
    solution : export JVM_ARGS="-XX:PermSize=64M -XX:MaxPermSize=256m"

  • Java.lang.NullPointerException in Parser

    Hi,
    I appreciate any idea that can help me.
    I'm processing a sql sentence that can retrive 10.000 rows with XSU.
    I generate xml files with 1000 rows from the resultset and then I transform this xmls into xml files based of Onix Standard.
    I've nullpointer exception in random way, but I supose that there is a problem when the xml files are transformed.
    There are any limitation for user parser and tranformer. I supose that there is a memory problem with this because the class consume a lot of CPU memory.
    Thank in advance.

    Thank every body.
    I increase -mx stack to 200 but the NullPointerexception followed showed in my screen.
    In that moment I'm running the java program with jdk1.2.2, because Jdeveloper look like very hard.
    Some of random exception are here:
    Java.lang.NullPointerException
    void java.io.OutputStreamWriter.write(char[], int, int)
    void oracle.xml.parser.v2.XMLOutputStream.flush()
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    Exception in thread main
    Se genero la excepcion al instanciar un Stylesheet
    java.lang.NullPointerException
    java.lang.String java.lang.String.intern()
    java.lang.String oracle.xml.parser.v2.XSLParseString.getQname()
    int oracle.xml.parser.v2.XSLParseString.nextToken()
    oracle.xml.parser.v2.XSLExprBase oracle.xml.parser.v2.XSLNodeSetExpr.parse(oracle.xml.parser.v2.XSLParseString, boolean, boolean)
    oracle.xml.parser.v2.XSLPatternInt oracle.xml.parser.v2.XSLExprBase.createPattern(java.lang.String, oracle.xml.parser.v2.NSResolver)
    void oracle.xml.parser.v2.XSLTemplate.<init>(oracle.xml.parser.v2.XMLElement, oracle.xml.parser.v2.XSLStylesheet, int, int)
    void oracle.xml.parser.v2.XSLStylesheet.updateStylesheet(oracle.xml.parser.v2.XMLDocument, int)
    void oracle.xml.parser.v2.XSLStylesheet.initStylesheet(oracle.xml.parser.v2.XMLDocument, java.net.URL)
    void oracle.xml.parser.v2.XSLStylesheet.<init>(oracle.xml.parser.v2.XMLDocument, java.net.URL)
    void onix.XMLToFile.transform(oracle.xml.parser.v2.XMLDocument, java.lang.String, java.lang.String)
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Se genero la excepcion al procesarse el xsl
    java.lang.NullPointerException
    void oracle.xml.parser.v2.XSLProcessor.processXSL(oracle.xml.parser.v2.XSLStylesheet, oracle.xml.parser.v2.XMLDocument, java.io.OutputStream)
    void onix.XMLToFile.transform(oracle.xml.parser.v2.XMLDocument, java.lang.String, java.lang.String)
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Se genero onix_2000.xml
    java.lang.NullPointerException
    void java.lang.Runtime.gc()
    void java.lang.System.gc()
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Exception in thread main
    java.lang.NullPointerException
    java.lang.String java.lang.StringBuffer.toString()
    void oracle.xml.parser.v2.XMLPrintDriver.printEndTag(oracle.xml.parser.v2.XMLElement, boolean)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlGenerator.setGenerator(java.lang.String)
    void onix.IsbnXmlGenerator.<init>(java.lang.String)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    java.lang.NullPointerException
    void oracle.xml.parser.v2.XMLPrintDriver.printEndTag(oracle.xml.parser.v2.XMLElement, boolean)
    void oracle.xml.parser.v2.XMLPrintDriver.printEl ement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlGenerator.setGenerator(java.lang.String)
    void onix.IsbnXmlGenerator.<init>(java.lang.String)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    Somebody Know how can I use OracleXMLQuery getSAX method....I appreciate an examples.
    null

  • Reg:- Exception in thread "main" java.lang.NoClassDefFoundError

    Hi Friends,
    I am trying to connect to Central Management Server using Java.I have created a sample program.I set class path as
    D:\j2sdk1.4.2_14\lib;D:\Program Files\Business Objects\common\3.5\java\lib\rebean.wi.jar;D:\Program Files\Business Objects\common\3.5\java\lib\rebean.jar;D:\Program Files\Business Objects\common\3.5\java\lib\ceplugins.jar;D:\Program Files\Business Objects\common\3.5\java\lib\cesession.jar;D:\Program Files\Business Objects\common\3.5\java\lib\cecore.jar;D:\Program Files\Business Objects\common\3.5\java\lib\celib.jar;D:\Program Files\Business Objects\common\3.5\java\lib\.;.
    Source Code Sample.java
    import com.crystaldecisions.enterprise.ocaframework.ServiceNames;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.occa.pluginmgr.*;
    import com.crystaldecisions.sdk.plugin.*;
    import com.crystaldecisions.sdk.plugin.desktop.report.*;
    import com.crystaldecisions.sdk.plugin.desktop.user.*;
    import com.crystaldecisions.sdk.framework.*;
    import com.businessobjects.rebean.wi.LogicalOperator;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.businessobjects.rebean.wi.*;
    import java.util.*;
    import java.lang.StringBuffer;
    import java.io.*;
    public class Sample1
    public static void main(String[] args)
    System.out.println("After Method Call");
    String Juname = "Administrator";
    String Jpwd = "";
    String Jcms = "hst-pcs4892:6400";
    String Jauth = "secEnterprise";
    SDKException Jfailure = null;
    boolean JloggedIn = true;
    IEnterpriseSession JenterpriseSession=null;
    // If no session already exists, logon using the specified parameters.
    if (JenterpriseSession == null)
    try
    /* Attempt logon. Create an Enterprise session
    * manager object.
    ISessionMgr JsessionMgr = CrystalEnterprise.getSessionMgr();
    // Log on to BusinessObjects Enterprise.
    JenterpriseSession = JsessionMgr.logon(Juname, Jpwd, Jcms, Jauth);
    String JlogonToken = JenterpriseSession.getLogonTokenMgr().getDefaultToken();
    catch (SDKException error)
    System.out.println("Exception Occured");
    JloggedIn = false;
    Jfailure = error;
    //System.out.println(JloggedIn);
    I am getting the following error
    Exception in thread "main" java.lang.NoClassDefFoundError: com/crystaldecisions/thirdparty/org/omg/CORBA/TRANSIENT
    at com.crystaldecisions.enterprise.ocaframework.ServiceMgrFactory.getServiceMgr(Unknown Source)
    at com.crystaldecisions.sdk.occa.security.internal.m.<init>(Unknown Source)
    at com.crystaldecisions.sdk.occa.security.internal.SecurityFactory.makeSecurityMgr(Unknown Source)
    at com.crystaldecisions.sdk.framework.internal.d.<init>(Unknown Source)
    at com.crystaldecisions.sdk.framework.internal.CEFactory.makeSessionMgr(Unknown Source)
    at com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr(Unknown Source)
    at Sample1.main(Sample1.java:46)
    Please help me resolve this.
    Regards,
    Sriram.
    [email protected]

    Hi Cotton,
    First let me thank you for responding to this
    thread.I gave the class path where all these are
    availableJava disagrees with you.
    Do you know which jar com.crystaldecisions.thirdparty.org.omg.CORBA/TRANSIENT is supposed to be in?

  • Incorrect XPath:,Exception in thread "main" java.lang.OutOfMemoryError:

    Hi All,
    We are having a Java Concurrent Program with Output as "Text" format.
    We are encountered with the below error.
    Can anyone help me on this..
    Incorrect XPath: (((not(CF_SO_LINK!=''))or CF_ITEM_TYPE='SATO' or(CF_ITEM_TYPE='ATO' and CF_ITM_TP_CD!='CONFIG')or (not(CF_ATO_LINE_ID!='')and CF_TOP_MDL_ID!='' and(CSHIP='Y' or CINV='Y'))or CF_ITEM_TYPE='EXT_WRT')an d CF_FLOW_ST_CD!='CANCELLED')or SALES_LINE_ID='' Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:3209) at java.lang.String.<init>(String.java:216) at java.lang.StringBuffer.toString(StringBuffer.java:585) at oracle.apps.xdo.batch.BurstingProcessorEngine.applyGroupBreak(BurstingProcessorEngine.java:2315) at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(BurstingProcessorEngine.java:1983) at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1135) at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(BurstingProcessorEngine.java:2177) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(BurstingProcessorEngine.java:1809) at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1138) at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingConfigParser(BurstingProcessorEngine.java:979) at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:913) at oracle.apps.xdo.batch.DocumentProcessor.process(DocumentProcessor.java:214) at
    Thanks
    gt1982

    i m getting Exception in thread "main"
    java.lang.OutOfMemoryError,
    please help meHow?
    You are leaking memory or attempting to use to much. There is a bug in your code.

  • Java.lang.ClassCastException when returing a Corba obect from VisiBroker

    Hello,
    I am having a peculiar problem.
    I am Using Weblogic 8.1 and VisiBroker Corba Server.I am able to deploy the WAR file Successfully .From One of the JSP, i am binding to a Corba object deployed on VisiBroker and trying to get a detail using the Corba object. I am able to bind and get the Corba object.
    I am initialising the ORB as Follows:
    properties.put ("org.omg.CORBA.ORBClass", "com.visigenic.vbroker.orb.ORB");
    properties.put ("org.omg.CORBA.ORBSingletonClass", "com.visigenic.vbroker.orb.ORB");
    orb = ORB.init((String[])null, properties);
    then iam binding using Helper class.My reference to binding is stored in objRef.
    Now when i try to invoke the Corba object and get the details(The get_call_details() return an Object )
    Object o =objRef.get_call_details(userName, password, csoNumber);
    i am getting Obect, O as NULL.
    I am getting the below mentioned error in My weblogic Console as well:
    java.lang.ClassCastException: CentralRepair32.CaseStatusDetails
    at weblogic.iiop.IIOPInputStream.read_IDLEntity(Lorg/omg/CORBA/portable/
    InputStream;Ljava/lang/Class;)Lorg/omg/CORBA/portable/IDLEntity;(IIOPInputStream
    .java:2095)
    at weblogic.corba.idl.AnyImpl.read_value(Lorg/omg/CORBA/portable/InputSt
    ream;Lorg/omg/CORBA/TypeCode;)V(AnyImpl.java:205)
    at CentralRepair32.CaseStatusDetailsHelper.insert(Lorg/omg/CORBA/Any;LCe
    ntralRepair32/CaseStatusDetails;)V(CaseStatusDetailsHelper.java:281)
    at CentralRepair32.CaseStatusDetails.toString()Ljava/lang/String;(CaseSt
    atusDetails.java:359)
    at java.lang.String.valueOf(Ljava/lang/Object;)Ljava/lang/String;(Unknow
    n Source)
    at java.lang.StringBuffer.append(Ljava/lang/Object;)Ljava/lang/StringBuf
    fer;(Unknown Source)
    at com.hp.sdow.corba.service.CRMDeliveryClient.getCallDetails(Ljava/lang
    /String;)LCentralRepair32/CaseStatusDetails;(Unknown Source)
    at com.hp.sdow.ics.CaseStatusSearchBean.getCallDetails(Ljava/lang/String
    ;)Lcom/hp/sdow/vo/CaseStatusDetailsVO;(Unknown Source)
    at jsp_servlet._jsp._ics.__icsflowcontroller._jspService(Ljavax/servlet/
    http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(__icsflowcont
    roller.java:203)
    at weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Lj
    avax/servlet/ServletResponse;)V(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    ()Ljava/lang/Object;(ServletStubImpl.java:1072)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/Filte
    rChainImpl;)V(ServletStubImpl.java:465)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/Filte
    rChainImpl;)V(ServletStubImpl.java:526)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run()Ljava/lang/Object;(WebAppServletContext.java:6981)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/se
    curity/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Objec
    t;(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/ac
    l/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSub
    ject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:12
    1)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogi
    c/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponse
    Impl;)V(WebAppServletContext.java:3892)
    at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel
    /ExecuteThread;)V(ServletRequestImpl.java:2766)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest
    ;)V(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
    at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Sourc
    e)
    <Jan 28, 2006 5:43:41 PM GMT+05:30> <Error> <HTTP> <BEA-101020> <[ServletContext
    (id=4413544,name=sdow,context-path=/sdow)] Servlet failed with Exception
    java.lang.NullPointerException
    at com.hp.sdow.ics.CaseStatusSearchBean.getCallDetails(Ljava/lang/String
    ;)Lcom/hp/sdow/vo/CaseStatusDetailsVO;(Unknown Source)
    at jsp_servlet._jsp._ics.__icsflowcontroller._jspService(Ljavax/servlet/
    http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(__icsflowcont
    roller.java:203)
    at weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Lj
    avax/servlet/ServletResponse;)V(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    ()Ljava/lang/Object;(ServletStubImpl.java:1072)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/Filte
    rChainImpl;)V(ServletStubImpl.java:465)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/Filte
    rChainImpl;)V(ServletStubImpl.java:526)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servle
    t/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run()Ljava/lang/Object;(WebAppServletContext.java:6981)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/se
    curity/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Objec
    t;(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/ac
    l/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSub
    ject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:12
    1)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogi
    c/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponse
    Impl;)V(WebAppServletContext.java:3892)
    at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel
    /ExecuteThread;)V(ServletRequestImpl.java:2766)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest
    ;)V(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
    at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Sourc
    e)
    >
    Please some one Help me. This is a very URGENT need.
    Thanks,
    Deepak.H.P

    Hi,
    1. BPEL Ver 10.1.3.x
    We have a process which accepts UserToken. I found out that this exception is thrown when soap:Header is added to the message.
    <soap:Header>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
    <wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
    <wsse:Username>user</wsse:Username>
    <wsse:Password Type="wsse:PasswordText">pass</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    Is there any setting has to be done?
    Thanks,
    AP

  • SPNego fails: Error creating GSS context - java.lang.NullPointerException

    Hi,
    I have successfully configured SPNego logon to the first portal in our landscape, however, on the next portal I've got to the SPNego logon is failing.
    When using the diagtool to analyse the problem tests 1-5 and 7 are passing successfully, however, test 6 is failing.
    I am configuring against the following software components:
    SAP J2EE - 7.00 SP13
    Sun JDK version: 1.4.2_14
    diagtool version 1.7.2
    MS Active Directory is configured as the EP UME with resolution mode simple.
    I believe the problem is in some way related to the authentication of the j2ee-<sid> user, however, I cannot narrow it down further. The password for this user has not changed since I generated the keytab file.
    Any help greatly appreciated.
    The following error is written to the diagtool trace file:
    Error creating GSS context.
    [EXCEPTION]
    GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new ACCEPT credentials failed!)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:189)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getInstance(Krb5AcceptCredential.java:80)
    at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:75)
    at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:149)
    at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:334)
    at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:44)
    at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:102)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.createGSSContext(Krb5ServerTest.java:104)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.execute(Krb5ServerTest.java:75)
    at com.sap.engine.config.diagtool.Task.execute(Task.java:55)
    at com.sap.engine.config.diagtool.Launcher.run(Launcher.java:343)
    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:324)
    at com.sap.engine.config.diagtool.Launcher.main(Launcher.java:394)
    Caused by: javax.security.auth.login.LoginException: java.lang.NullPointerException
    at java.lang.StringBuffer.append(StringBuffer.java:467)
    at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:576)
    at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:475)
    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:324)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
    at sun.security.jgss.LoginUtility.run(LoginUtility.java:57)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:186)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getInstance(Krb5AcceptCredential.java:80)
    at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:75)
    at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:149)
    at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:334)
    at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:44)
    at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:102)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.createGSSContext(Krb5ServerTest.java:104)
    at com.sap.engine.config.diagtool.tests.authentication.krb.Krb5ServerTest.execute(Krb5ServerTest.java:75)
    at com.sap.engine.config.diagtool.Task.execute(Task.java:55)
    at com.sap.engine.config.diagtool.Launcher.run(Launcher.java:343)
    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:324)
    at com.sap.engine.config.diagtool.Launcher.main(Launcher.java:394)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:730)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
    at sun.security.jgss.LoginUtility.run(LoginUtility.java:57)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jgss.krb5.Krb5AcceptCredential.getKeyFromSubject(Krb5AcceptCredential.java:186)
    ... 15 more
    Acquire credential failed for realm EUR.EMIGRP.COM

    Hello CJH,
    Thank you for following up.
    I will set the thread status to "assumed answered".
    Cheers,
    Julius

  • "java.lang.OutOfMemoryError: Java heap space"  while trying to read Excel.

    Hi Experts,
    Here is my query. I'm trying to upload excel data into database table. This excel contains more than 20000 records. I'm storing this data in a vector after reading it & passing this vector as a parameter to another method(not mentioned in the below code) which writes into the database. The code works for records <4000, but fails to read beyond that & throws exception as below.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Java heap space
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:433)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: Java heap space
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.readexcelsap_jsp._jspService(readexcelsap_jsp.java:365)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.OutOfMemoryError: Java heap space
    Below is the code for reference. Kindly Help me in getting this heap space error rectified or suggest me alternate ways.
    I tried increasing Heap space as googled but in vain.
    <%!
    private Vector readExcelSheet(String uploadedFilePath, int sheetNo) throws IOException
         Vector allRowInfo = null;
            try
                HSSFSheet sheet= getWorkSheet(uploadedFilePath,sheetNo);
                //System.out.println(uploadedFilePath);
                //System.out.println(sheetNo);
                //System.out.println("--Sheet--"+sheet);
                //System.out.println("--Sheet--"+sheet.getLastRowNum());
                if(sheet!=null)
                allRowInfo = new Vector();
                for(int i=0;i<=sheet.getLastRowNum();i++)
                    HSSFRow row= sheet.getRow(i);
                    Vector eachRowInfo = new Vector();
                    for(short j=0;j<row.getLastCellNum();j++)
                        eachRowInfo.add(getCellContents(row.getCell(j)));
                        //System.out.println("--"+row.getCell(j));
                    allRowInfo.add(eachRowInfo);
                else
                     allRowInfo = null;
                //return allRowInfo;
            catch (FileNotFoundException ex)
                 System.out.println("-- Error in reading--getWorkSheet -- 1--"+ex);
                 allRowInfo = null;
            catch (IOException ex)
                 System.out.println("-- Error in reading--getWorkSheet-- 2 --"+ex);
                 allRowInfo = null;
            catch (IndexOutOfBoundsException ex)
                 System.out.println("-- Error in reading--getWorkSheet-- 2 --"+ex);
                 allRowInfo = null;
            catch (NullPointerException ex)
                 System.out.println("-- Error in reading--getWorkSheet --"+ex);
                 allRowInfo = null;
            catch(Exception e)
                System.out.println(e.getMessage());
                e.printStackTrace();
                 allRowInfo = null;
            return allRowInfo;
    %>
    <%!
    private HSSFSheet getWorkSheet(String uploadedFilePath, int sheetNo) throws IOException
            HSSFSheet sheet = null;
            try
                FileInputStream inputStream=new FileInputStream(uploadedFilePath);
                POIFSFileSystem poisFile=new POIFSFileSystem(inputStream);
                HSSFWorkbook workBook= new HSSFWorkbook(poisFile);
                sheet = workBook.getSheetAt(sheetNo);
            catch (FileNotFoundException ex)
                 System.out.println("-- Error in reading--getWorkSheet --"+ex);
                 sheet = null;
            catch (IOException ex)
                 System.out.println("-- Error in reading--getWorkSheet --"+ex);
                 sheet = null;
            catch (IndexOutOfBoundsException ex)
                 System.out.println("-- Error in reading--getWorkSheet --"+ex);
                 sheet = null;
            catch (NullPointerException ex)
                 System.out.println("-- Error in reading--getWorkSheet --"+ex);
                 sheet = null;
            catch(Exception e)
                System.out.println(e.getMessage());
                e.printStackTrace();
                sheet = null;
             return sheet;
    %>
    <%!
    public String getCellContents(HSSFCell cell)
            String cellValue="";
            String cellValue1="";
            if(cell!=null)
                 int cellType= cell.getCellType();
                if(cellType==HSSFCell.CELL_TYPE_NUMERIC)
                    cellValue=(float)cell.getNumericCellValue()+"";           
                if(cellType==HSSFCell.CELL_TYPE_STRING)
                     cellValue1=cell.getStringCellValue();
                     StringBuffer sb = new StringBuffer();
                     for(int i = 0; i < cellValue1.length(); i++)
                            sb.append(cellValue1.charAt(i));
                         if(cellValue1.charAt(i)=='\'')
                              sb.append('\'');
                     cellValue = sb.toString();
           return cellValue;
    %>
    <html>
    <body>
    <%
         String file_Name="Myexcel.xls";
         String path = "D://Test Upload//"+file_Name;
         Vector list = readExcelSheet(path,0);
    </html>
    </body>Regards
    Venky
    Edited by: Venky_86 on Jun 17, 2009 6:05 AM

    HOW did you increase the heap space? As that is the only solution you have in this case really.
    It is a known fact that POI can use up a lot of memory for big spreadsheets. If at all possible, I would try to switch to plain text comma separated files / tab delimited files. If you cannot do that, I would try to put a size restriction on the sheets that your application will process to get rid of the heap space risk. A sheet can contain 20000 records, or four sheets can contain 5000 records; in both cases you process the exact same data, but at only 25% of the total memory usage.

  • Java.lang.Runtime.exec problem in ubuntu 9.10

    Hi:
    I tried to run some command in the java code , for example "grass64 -text /home/data/location", this command works well in the terminal, however when I call it in the java code I got some excepetions.
    My code is :
    public class Grass {
         public static String grassBatJob="GRASS_BATCH_JOB";
         public void run(String cmd,String jobPath) {
              //set the environments variables
              Map<String, String> env=new HashMap<String, String>();
              env.put(grassBatJob, jobPath);
              String gisDataBase="/home/kk/grass/GrassDataBase";
              String location="spearfish60";
              String mapset="PERMANENT";
              cmd=cmd+" "+gisDataBase+"/"+location+"/"+mapset;
              CommandLine line=new CommandLine(cmd);
              //the real cmd should be >>grass64 -text /home/kk/grass/GrassDataBase/spearfish60/PERMANENT
              System.out.println("start line=="+line.toString());
              DefaultExecutor de=new DefaultExecutor();
              try {
                   int index=de.execute(line,env);
                   System.out.println(index);
              } catch (ExecuteException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              String jobPath=Grass.class.getResource("grass.sh").getFile();
              new Grass().run("grass64 -text", jobPath);
    The real cmd I want to execute is "grass64 -text /home/kk/grass/GrassDataBase/spearfish60/PERMANENT" with the envrionment variable "GRASS_BATCH_JOB=jobPath",it works well in the ternimal ,however in my application I got the exception"
    java.io.IOException: Cannot run program "grass64 -text /home/kk/grass/GrassDataBase/spearfish60/PERMANENT": java.io.IOException: error=2, No such file or directory
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
         at java.lang.Runtime.exec(Runtime.java:593)
         at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
         at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:246)
         at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:302)
         at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:149)
         at org.kingxip.Grass.run(Grass.java:27)
         at org.kingxip.Grass.main(Grass.java:38)
    Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
         ... 7 more
    I wonder why?

    Thanks for all of your reply, and now I can run the command, however I met some problems when I tried to get the result of the exec.
    The core codes are shown below:
    String cmd="g.version";
    String[] exe={"bash","-c",cmd};
    Process p1=Runtime.getRuntime.exec(exe,env); // the env has been set
    GrassThread outThread=new GrassThread("out", p1.getInputStream());
    outThread.start();
    GrassThread errorThread=new GrassThread("error", p1.getErrorStream());
    errorThread.start();
    int exitVal = p1.waitFor();
    String resu=outThread.sb.toString();
    System.out.println("==========the output start========");
    System.out.println(resu);
    System.out.println("==========the output end========");
    System.out.println("ExitValue: " + exitVal); //------------------> line one
    public class GrassThread extends Thread{
         public StringBuffer sb=new StringBuffer();
         public GrassThread(String type,InputStream is) {
              this.type=type;
              this.is=is;
         public void run() {
              try {
                   InputStreamReader isr = new InputStreamReader(is);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   while ((line = br.readLine()) != null) {
                        System.out.println(type + ">" + line);
                        sb.append(line).append("\r");  // ----------------------------> line two
    }I define a StringBuffer in the GrassThread to save the output (see the code where I marked by "line two"), and when the process complete, I check the StringBuffer to get the output (see code where I marked by "line one"), however the output in the console of the IDE are :
    ----------- output in the console of the IDE start -------------
    ==========the output start========
    ==========the output end========
    ExitValue: 0
    out>GRASS 6.4.0RC5 (2009)
    ----------output in the console of the IDE end--------------------
    I can not understand, in the code "line one", I first get the output using "System.out.println(resu);",then I print the exitvalue,but why the order of the output in the console is not what I expected?
    Another question, the code above assume the output can be got from the Process's getInputStream, however sometimes the output maybe come from the Process's getErrorStream, so how to handle it?
    Edited by: apachemaven on 2010-3-5 ??5:38

  • Help with Exception in thread "main" java.lang.NullPointerException

    I got this exception while running the code in Netbeans IDE 6.1. The code is compiling fine...Please tell me what the problem is
    Exception in thread "main" java.lang.NullPointerException
    at Softwareguide.chooseanswer(Softwareguide.java:32)
    at Driver.main(Driver.java:7)
    public class Driver
        public static void main(String[] args)
            Softwareguide swguide = new Softwareguide();
            swguide.chooseanswer();
    public class Softwareguide
        State test1;
        State test2;
        State test3;
        State test4;
        State test5;
        State subtest1;
        State subtest2;
        State subtest3;
        State subtest4;
        State subtest5;
        State state = test1;
        public Softwareguide()
            test1 = new Test1(this);
            test2 = new Test2(this);
            test3 = new Test3(this);
            test4 = new Test4(this);
            test5 = new Test5(this);
            subtest1 = new SubTest1(this);
            subtest2 = new SubTest2(this);
            subtest3 = new SubTest3(this);
            subtest4 = new SubTest4(this);
            subtest5 = new SubTest5(this);
        public void chooseanswer()
            state.chooseanswer();
       /* public void chooseyes()
            state.chooseyes();
        public void chooseno()
            state.chooseno();
        public State getState()
            return state;
        void setState(State state)
         this.state = state;
        public State getTest1State()
            return test1;
        public State getTest2State()
            return test2;
        public State getTest3State()
            return test3;
        public State getTest4State()
            return test4;
        public State getTest5State()
            return test5;
        public State getsubTest1State()
            return subtest1;
        public State getsubTest2State()
            return subtest2;
        public State getsubTest3State()
            return subtest3;
        public State getsubTest4State()
            return subtest4;
        public State getsubTest5State()
            return subtest5;
        public String toString()
            StringBuffer result = new StringBuffer();
            result.append("\n Starting Diagnostic Test...");
            return result.toString();
    }

    spiderjava wrote:
    the variable state is assigned to test1. This variable(test1) is not initialized anywhere.It is initialized in the c'tor. Which is invoked after the "global" object and attribute initialization. So it is there, but comes too late.
    You should definitly not write a technical Java blog and post it all over the place.

  • Exception in thread "main" java.lang.OutOfMemoryError(please help me )

    Hi All
    here my java class trying to read a txt file(which is having size of 60MB).and putting each line into a Vector class. problem is ,upto certain number of line it is reading properly and putting into vector..after that it is giving error like Exception in thread "main" java.lang.OutOfMemoryError..what is the problem and how to rectify this one..anybody help me on this.
    actual situation is one txt is there in that 80 lakhs of lines of content is there..java file trying to read each line and put it into vector or stringbuffer and split it into two lines like key=value and put it into hashmap object.then finally iam creating new file(.properties) and writing these hashmap data on it. if you want clearly..please look into below code..
    package test.utf8; import java.io.*; import java.util.*; public class AssetUtils
    //static StringBuffer stringbuffer = new StringBuffer();
    public AssetUtils()
    public static void main(String args[]) throws IOException
    BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream("D:\\list.txt")));
    Vector vector = new Vector(0x30D40, 50000);
    System.out.println(vector.capacity());
    Object obj = null;
    int n=0;
    System.out.println("Reading list:" + new Date(System.currentTimeMillis()));
    do
    String s = bufferedreader.readLine();
    //System.out.println("line no: "+ ++n);
    if(s == null)
    break;
    vector.add(s);
    } while(true);
    System.out.println("List Read complete:" + new Date(System.currentTimeMillis()));
    String s1 = args[0];
    System.out.println("S1: "+s1);
    System.out.println(vector.capacity());
    HashMap hashmap = new HashMap();
    System.out.println( "Vector.Size..>>>>>>>>>>>>>>>>.."+vector.size());
    for(int i = 0; i < vector.size(); i++)
    System.out.println("i value:"+i);
    String s2 = (String)vector.get(i);
    //System.out.println("S2: "+s2);
    if(s2.indexOf("/") != -1)
    String s3 = s2.substring(s1.length(), s2.length());
    //System.out.println("S3: "+s3);
    if(s3.indexOf("/") != -1) {
    String s4 = s3.substring(0, s3.lastIndexOf("/"));
    //System.out.println("S4: "+s4);
    String s6 = s3.substring(s3.lastIndexOf("/") + 1, s3.length());
    //System.out.println("S6: "+s6);
    StringBuffer stringbuffer=null;
    stringbuffer = new StringBuffer();
    String s8 = (String)hashmap.get(s4);
    //System.out.println("S8: "+s8);
    if(s8 != null) stringbuffer.append(s8 + "," + s6);
    else
    stringbuffer.append(s6);
    hashmap.put(s4, stringbuffer.toString());
    //stringbuffer.delete(0,stringbuffer.length());
    stringbuffer=null;
    System.out.println("Opening asset.properties:" + new Date(System.currentTimeMillis()));
    File file = new File("D:\\asset.properties");
    PrintWriter printwriter = new PrintWriter(new FileOutputStream(file));
    String s5;
    String s7;
    for(Iterator iterator = hashmap.keySet().iterator(); iterator.hasNext(); printwriter.println(s5 + "=" + s7))
    { s5 = (String)iterator.next(); s7 = (String)hashmap.get(s5); } printwriter.close();
    System.out.println("Closing asset.properties:" + new Date(System.currentTimeMillis()));

    Theres a number of ways you can improve your memory usage:
    1) Build you map as you read in your file.
    2) Use StringBuffers in your map - do not use "asshaj" + "ashaskj" This is very memory intensive
    If you still run out of memory try running the JVM using -Xms128m -Xmx512m or higher

  • Java.lang.NoSuchMethodError with JDeveloepr 10g

    HI,
    I have a problem with java.lang.NoSuchMethodError in Jdeveloper 10g. The code works fine in Jdeveloper 9iAS. I just migrated them to 10g.
    Here is the error:
    java.lang.NoSuchMethodError: java.util.ArrayList com.ncilp.intranet.CourseHelperBean.getAllCoursesByPosition(int, int)     at com.ncilp.intranet.SelectCourseForm.getCourseSelection(SelectCourseForm.java:72)     at com.ncilp.intranet.SelectCourseForm.reset(SelectCourseForm.java:55)     at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:640)     at selectcourse.jspService(_selectcourse.java:74)     [selectcourse.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    This is source code for SelectCourseForm.java
    package com.ncilp.intranet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import java.util.*;
    public class SelectCourseForm extends ActionForm {
    private String _courseName = new String();
    public String getCourseName() {
    return _courseName;
    public void setCourseName(String courseName) {
    _courseName = courseName;
    private int _courseId = 0;
    public int getCourseId() {
    return _courseId;
    public void setCourseId(int courseId){
    _courseId = courseId;
    private Hashtable pageMap = new Hashtable();
    public Hashtable getPageMap() {
    return this.pageMap;
    public void setPageMap(Hashtable pgMap) { this.pageMap = pgMap; }
    private ArrayList courseLists;
    public ArrayList getCourseLists()
    return this.courseLists;
    public void setCourseLists(ArrayList courses)
    this.courseLists = courses;
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    UserEntityBean userDB = (UserEntityBean)request.getSession().getAttribute("userDB");
    getCourseSelection(request, userDB.getPositionid());
    super.reset(mapping, request);
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    return super.validate(mapping, request);
    private void getCourseSelection(HttpServletRequest request,int positionId)
    try{
    CourseHelperBean courseBean = new CourseHelperBean();
    Integer userId = (Integer)request.getSession().getAttribute("UserId");
    ArrayList courseList;
    courseList = courseBean.getAllCoursesByPosition(positionId, userId.intValue()); this.courseLists = courseList;
    request.getSession().setAttribute("courseOptions", courseList);
    catch(Exception ex)
    ex.printStackTrace();
    This is part of source code of CourseHelperBean.java
    package com.ncilp.intranet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    public class CourseHelperBean
    public CourseHelperBean()
    * get course info by courseid
    public CourseEntityBean getCourse(int courseid)
    throws IOException, SQLException, NamingException {
    CourseEntityBean object = null;
    // Get a connection.
    Connection conn = DBUtil.getConnection(jdbcEntry);
    StringBuffer st = new StringBuffer( "select title, course_order, description, language from intra_course where courseid = :1 ");
    // Create the prepared statement.
    PreparedStatement stmt = conn.prepareStatement( st.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
    //Bind variable
    stmt.setInt(1, courseid);
    // Execute the query.
    ResultSet rs = stmt.executeQuery();
    String title = null;
    String number = null;
    String description = null;
    String language = null;
    if( rs != null && rs.first() )
    title = rs.getString( 1 );
    title = rs.getString( 2 );
    description = rs.getString( 3 );
    language = rs.getString( 4 );
    object = new CourseEntityBean( courseid,
    title,
    number,
    description,
    language,
    null
    rs.close();
    stmt.close();
    conn.close();
    return object;
    * get all courses needed to be taken for positionid
    public ArrayList getAllCoursesByPosition(int positionid, int userid)
    throws IOException, SQLException, NamingException {
    ArrayList beans = null;
    SectionHelperBean sectionBean = new SectionHelperBean();
    // Get the connection
    Connection conn = DBUtil.getConnection(jdbcEntry);
    StringBuffer st = new StringBuffer( "select a.courseid, a.title, a.course_order, a.description, a.language ");
    st.append( " from intra_course a, intra_position_course b ");
    st.append( " where b.course_id = a.courseid and b.position_id = :1 ");
    st.append( " order by course_order ");
    // Create the prepared statement.
    PreparedStatement stmt = conn.prepareStatement( st.toString() );
    // Bind the params.
    stmt.setInt( 1, positionid );
    // Execute the query.
    ResultSet rs = stmt.executeQuery();
    int courseid = 0;
    String title = null;
    String number = null;
    String description = null;
    String language = null;
    String status = null;
    ArrayList sections = null;
    beans = new ArrayList( rs.getFetchSize() );
    if( rs != null )
    while( rs.next() ) {
    courseid = rs.getInt( 1 );
    title = rs.getString( 2 );
    number = rs.getString( 3 );
    description = rs.getString( 4 );
    language = rs.getString( 5 );
    sections = sectionBean.getAllSectionByCourse(courseid, userid);
    if( sections.size() == 0 )
    status = "Done";
    else
    status = "Not Done";
    beans.add(new CourseEntityBean( courseid,
    title,
    number,
    description,
    language,
    status
    rs.close();
    stmt.close();
    conn.close();
    return beans;
    These two classes are in the same directory, same package. Can anyone tell me what's wrong? How to fix it?
    Thank you very much.
    Juan

    Hi,
    did you recompile the application ?
    Frank

  • Java.lang.NoClassDefFoundError in Linux when I execute my class

    I don't know to happen but I tried all things.
    I compile well my .java but I have problems when I want to execute my class
    the console send me the next error
    Exception in thread "main" java.lang.NoClassDefFoundError : renco
    1. unset CLASSPATH.
    2. define my CLASSPATH again with jars that I need you
    java renco
    the console send me this error
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    well, this error I managed with try-catch-finally
    3. compile with:
    java -classpath /directory/myjar.jar renco.java
    the console send mi this:
    Exception in thread "main" java.lang.NoClassDefFoundError : renco
    Other hand, when i use forte for java by execute my class, it execute well. I want to know what commands the IDE used.
    thanks

    this mi code
    * renco.java
    * Created on 22 de agosto de 2003, 8:59
    * @author mloayza
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class renco {
    /** Creates a new instance of reniec */
    public String sqlNoticia;
    public String sqlCodigoNoticia;
    public String sqlComunicado;
    public String pathInc;
    private Connection cn;
    public static void main(String args[]) throws Exception {
    renco RN = new renco();
    int estado = RN.proceso();
    System.out.println(estado);
    public renco() throws IOException{
    sqlComunicado= " SELECT TO_CHAR(fecha,'dd/mm/yyyy') fecha, "+
    " resumen resumen, "+
    " id_comunicado codigo "+
    " FROM intranet.int_comunicado "+
    " WHERE"+
    " id_comunicado = (SELECT max(id_comunicado) FROM intranet.int_comunicado) ";
    sqlCodigoNoticia = "SELECT MAX(codigo_nota) codigo "+
    " FROM intranet.nota_prensa ";
    sqlNoticia = " SELECT codigo_nota codigo, "+
    " titulo_nota titulo, TO_CHAR(fecha_nota,'dd/mm/yyyy') fecha "+
    " FROM intranet.nota_prensa "+
    " WHERE "+
    " codigo_nota > ( ? - 4) "+
    " ORDER BY codigo_nota DESC";
    //pathInc = this.LeeParametro("PathInc");
    cn = this.getCn();
    this.pathInc = "/das/por/";
    public Connection getCn() {
    String URL = "jdbc:oracle:thin:@200.20.12.12:1529:asdb";
    String USER = "qweqwe";
    String PASS = "qweqwe";
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cn = DriverManager.getConnection(URL,USER,PASS);
    catch(Exception sqle){
    cn = null;
    return cn;
    public void closeCn(Connection cn) throws SQLException {
    this.cn.close();
    cn= null;
    public int proceso(){
    ResultSet rs = null;
    StringBuffer textoComunicado = new StringBuffer();
    StringBuffer textoNoticia = new StringBuffer();
    int codigo = 0;
    int estado = 0;
    String URL = "jdbc:oracle:thin:@200.20.12.12:1529:asdb";
    String USER = "qweqwe";
    String PASS = "qweqwe";
    textoNoticia.append("<Script Language='JavaScript1.2'>");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller = new AJScroller();");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.width = 439;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.height = 55;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.scrollspeed = 50;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.pausedelay = 2000;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.pausemouseover = true;");textoNoticia.append((char)13);
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cn = DriverManager.getConnection(URL,USER,PASS);
    cn = getCn();
    FileOutputStream fosCom = new FileOutputStream(pathInc+"comunicado.inc"); //archivo Comunicado
    DataOutputStream dosCom = new DataOutputStream(fosCom);
    FileOutputStream fosNot = new FileOutputStream(pathInc+"noticia.inc"); //archivo Comunicado
    DataOutputStream dosNot = new DataOutputStream(fosNot);
    //Generacion de cadena para comunicados
    PreparedStatement psc = cn.prepareStatement(sqlComunicado);
    rs = psc.executeQuery();
    rs.next();
    textoComunicado.append("<font size='1' color='#505050'><b>)");textoComunicado.append((char)13);
    textoComunicado.append("("+ rs.getString("fecha") +") .- "+ rs.getString("resumen")+" ");textoComunicado.append((char)13);
    textoComunicado.append("</b></font><font size='1' color='orange'><b><br>");textoComunicado.append((char)13);
    textoComunicado.append("     <a href='/portal/s/portal.PIComunicado?codigo="+ rs.getString("codigo")+"'>M&aacute;s Detalles >></a>");textoComunicado.append((char)13);
    textoComunicado.append("</b></font>");textoComunicado.append((char)13);
    psc.close();psc=null;
    rs = null;
    //Generacion de cadena para comunicados
    //Obtencion del codigo de la ultima noticia
    PreparedStatement pscn = cn.prepareStatement(sqlCodigoNoticia);
    rs = pscn.executeQuery();
    rs.next();
    codigo = rs.getInt("codigo");
    rs = null;
    PreparedStatement psn = cn.prepareStatement(sqlNoticia);
    psn.setInt(1,codigo);
    rs = psn.executeQuery();
    while(rs.next()){
    textoNoticia.append("aj_scroller.add('<table ><tr><td class=rojo><font face=\"Webdings, Wingdings\">4</font></td><td class=rojo><font size=1 color=\"#143E7B\"><p align=\"justify\"><b>"+ rs.getString("Titulo") +" ("+ rs.getString("fecha") +")</b></font></td></table>');");textoNoticia.append((char)13);
    rs.close();rs=null;
    textoNoticia.append("aj_scroller.display();");textoNoticia.append((char)13);
    textoNoticia.append("</Script>");textoNoticia.append((char)13);
    dosCom.writeBytes(textoComunicado.toString());
    fosCom.close();fosCom = null;
    dosCom.close();dosCom=null;
    dosNot.writeBytes(textoNoticia.toString());
    fosNot.close();fosNot= null;
    dosNot.close();dosNot=null;
    closeCn(cn);
    estado=1;
    }catch(IOException ioe){
    estado = 0;
    catch(SQLException sqle){
    estado = 0;
    catch(ClassNotFoundException nfce){
    estado = 0;
    System.out.println(nfce);
    //nfce.printStackTrace();
    return estado;
    public String LeeParametro(String parametro) throws IOException, FileNotFoundException
         String path = System.getProperty("java.home");
              parametro = parametro.trim().toUpperCase();
              String valor = "";
         String s;
         try{
              BufferedReader br = new BufferedReader(new FileReader(path.trim().replace('\\','/')+"/Homepage.conf"));
                   while ((s = br.readLine())!= null) {
                        StringTokenizer st = new StringTokenizer(s, "=");
                        while (st.hasMoreTokens()){
                             String word = st.nextToken();
                             if (word.startsWith(parametro)) {
                             valor = st.nextToken().trim();
              catch (FileNotFoundException e) {
                   throw new FileNotFoundException ("Archivo no encontrado " path"/Homepage.conf");     }
              catch (IOException e) {
                   throw new IOException ("Error al leer "+path+"/Homepage.conf");     }
              return valor;

Maybe you are looking for

  • How to delete the new user added while install maverick

    while upgrade my os x 10.8 to maverick, it ask me to create a new user. after that, a folder for the new user is created in the /Users, but there is no information for this new user in the System Preferences -> Users & Groups, i can't event delete th

  • I have no audio when using chrome

    I have no audio when using chrome. I have audio when using Internet explorer and when playing from my pc. I have tried uninstalling chrome and flash player then reinstalling them. have tried FAQ on chromes site and Adobe's site. did not work.

  • Deployed/Suspension

    I am currently deployed to Afghanistan. As we do not have CDMA in this country, I cannot use my phone. If I suspend my plan, will there be any negative impacts? If I lose my unlimited data plan, I will definitely definitely definitely move my account

  • Oracle 8i (8.1.5) and linux : Bad adresse

    Hi, When i try to instal Oracle 8.1.5, et have the message : Initializing Java Virtual Machine from /usr/local/jre/bin/jre. Please wait... Error in CreateOUIProcess(): -1 : Mauvaise adresse Someone can help me ? null

  • HELP! Slow logon with Cached Credentials off domain. Have xperf files.

    Having issues when you take a corporate laptop off domain and log in using cached credentials. Login times range from 2-4 minutes. This is with SSD. No problem logging in on network. Only way to speed up login off network is disable wireless. I ran x