Java 1.6 BigDecimal Issue

Hi
I am facing an issue using BigDecimal in Java 1.6
BigDecimal bd = new Bigdecimal ("0.000000000").setScale(9,BigDecimal.ROUND_FLOOR);
System.out.println (bd);
I get the exponential output *0E-9* but I need this as a non exponential value i.e; 0.000000000
I do not want to use bd.toPlainString(); method as I need the BigDecimal object and not a String object. I will have to pass this BigDecimal value to an end system running on Java1.4. Could you please help me sort out this issue ?
Rgds, Raj.

1001963 wrote:
I have to construct an xml whose xsd definition had decimal as the datatype for one of the tag. When I was working on Java1.4, I was able to pass the BigDecimal as is but after switching to Java1.6, the xml validation fails.
That doesn't answer the question. Please stop telling us that it fails at the external system and start telling us how your code works.
One of the following is true.
- You are using a XML library and you are passing BigDecimal TO IT
- You wrote code that creates XML and you are transforming BigDecimal yourself using BigDecimal.toString() - either explicitly or implicitly.
Which one is it?

Similar Messages

  • Regarding Sun Java System Application Server Issue with JVM

    Regarding Sun Java System Application Server Issue with JVM
    Hi
    I have installed SJSAS9.1 on solaris system. I m trying to deploy war file which i compiled in windows enviorment by jdk1.5.0_05. Every time i got the following error :
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP
    PWC6199: Generated servlet error:
    [javac] javac: invalid target release: 1.5
    [javac] Usage: javac
    [javac] where possible options include:
    [javac] -g Generate all debugging info
    [javac] -g:none Generate no debugging info
    [javac] -g:{lines,vars,source} Generate only some debugging info
    [javac] -nowarn Generate no warnings
    [javac] -verbose Output messages about what the compiler is doing
    [javac] -deprecation Output source locations where deprecated APIs are used
    [javac] -classpath Specify where to find user class files
    [javac] -sourcepath Specify where to find input source files
    [javac] -bootclasspath Override location of bootstrap class files
    [javac] -extdirs Override location of installed extensions
    [javac] -d Specify where to place generated class files
    [javac] -encoding Specify character encoding used by source files
    [javac] -source Provide source compatibility with specified release
    [javac] -target Generate class files for specific VM version
    [javac] -help Print a synopsis of standard options
    note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs.
    I have cheked jvm version on both system the only difference is :
    Solaris points to jdk 1.5.0_09
    Windows point to jdk1.5.0_05
    Even i tried to run blank jsp also but again i got the same error.
    Can any help me to sort out the problem or give me any idea so i can do something by my own.
    Thanks in Advance
    Gagan

    Do you have ANT installed and available?
    Thanks,
    Kedar

  • Calling a procedure from java, conversion from bigdecimal to number(13,3)

    Hello
    i have a procedure that i call from a java api
    among the parameter that i give to the procedure there is a bigdecimal parameter
    then i have to insert this value in a table
    the colum concerned has number(13.3) as a type
    here is the java call :
    ps.setBigDecimal(5,value );
    so what type should i declare for the procedure parameter for the bigdecimal parameter
    and is there a conversion to do
    Regards
    Sallemel

    Data types are defined by the data not a column definition. What are the range of values possible in the data that must be manipulated. Give examples.

  • Not only does Adobe flashplayer continue to crash on my operating system (windows 7) but now java script is having issues .... what is wrong with firefox????

    for months I have checked the forums, and seen the same issues with Adobe Flash Player ... I have uninstalled and reinstalled too many times now and am totally frustrated with Firefox,. I just get it working again and Firefox updates and then I have the same issues ... and now my java script is screwing up and it never did before .... this all came after the latest update .... is anyone else having these issues or is my operating system under attack???

    Recent crashes of certain multimedia contents (this includes Youtube videos, certain flash games and other applications) in conjunction with Firefox are most probably caused by a recent Flash 11.3 update and/or a malfunctioning Real Player browser plugin.
    In order to remedy the problem, please perform the steps mentioned in these Knowledge Base articles:
    [[Flash Plugin - Keep it up to date and troubleshoot problems]]
    [[Flash 11.3 crashes]]
    [[Flash 11.3 doesn't load video in Firefox]]
    Other, more technical information about these issues can be found under these Links:
    http://forums.adobe.com/thread/1018071?tstart=0
    http://blogs.adobe.com/asset/2012/06/inside-flash-player-protected-mode-for-firefox.html
    Please tell us if this helped!

  • Java PDK Bugs and Issues

    Here are some bugs and issues I've run across using the JPDK that I thought other
    developers should be aware of. The following information comes from using JPDK
    1.1 with Oracle Portal Version 3.0.6.3.3 Early Adopter on Windows 2000.
    1) Do not use a colon character (':') in the String value returned by the method getTitle( Locale l ) in the class Portlet. Registering the provider will appear to succeed, but when you view the Portlet Repository you will get the following error message:
    An Unhandled Exception has occurred. ORA-06502: PL/SQL: numeric or value error:
    character to number conversion error
    Your provider and its portlets will not appear in the Portlet Repository when this error occurs.
    Perhaps other characters will cause this error as well.
    2) The Provider class method initSession() is supposed to propagate the array of returned Cookies back to the browser. The Cookies are never propagated to the browser. This is a huge road-block for our application and we need to have this problem fixed as there is no workaround.
    3) There is a limit to the number of portlets you can have per provider. I initially wrote a provider class that managed 19 portlet classes. However, after registering the provider only 17 portlet classes were loaded by the provider and/or displayed by the Portlet Repository. I had to create a second provider to manage additional portlets. The second provider worked out fine for me because I have 5 portlets that are for "administrator" users only. Moving these portlets left 14 portlets for the first provider to manage.
    Note: I don't know if this error occurs using the provider.xml method of implementing a provider and its portlets. My provider and portlets are implemented directly using the Java class API's.
    4) Sometimes I will receive the error "Meta data missing for portlet ID=<number>" when a portlet is rendered for the first time. This error does not occur often but when the error happens two conditions are met:
    a) The portlet is being rendered for the first time
    b) The HTTP and Web Assistant NT services have recently been started.
    This error is obviously caused by some timeout but increasing the timeout values
    for both the provider and the portlet has no effect. This error may be restricted to the NT platform.
    The following notes are not bugs but issues to be aware of:
    1) Make sure you have the "sessiontimeout" parameter defined when declaring the initArgs of a servlet in the zone.properties file and you intend to register your provider with a "Login Frequency" of "Once per User Session". For example:
    servlet.urlservlet.initArgs=debuglevel=1,sessiontimeout=1800000
    If you leave off the session timeout, Oracle Portal will call your provider's initSession() method for every request constantly generating new a session ID.
    2) Currently there is no means to check whether a ProviderUser has administrative
    privileges. This feature would be extremely helpful for restricting which portlets a user has access to when the provider's getPortlets() method is called.
    3) Currently there is no Java API for storing user and global preferences in the
    Oracle database. The JPDK provides a PersonalizationManager class but the method
    of storing the preferences needs to be implemented by the developer.
    The default Personalization Manager persists user preferences as a file
    to disk. However, this method opens up security holes and hinders scaleability.
    We got around the security and scalability issues by using Oracle's JDBC
    driver to persist user and global preferences to custom tables in the underlying Oracle database.
    I would appreciate hearing from anyone who has run across the cookie propagation issue and has any further insights.
    Thanks...
    Dave White
    null

    David,
    Thank you for your feedback on the JPDK. The information you provide helps us understand how customers are using 9iAS
    Portal and its development kits. I apologize for the delay in getting back with you. Since you are using the Early Adopters
    release, we wanted to test a few of the bugs and issues on the production release of 9iAS Portal.
    1) Using a colon character (:) in the String value returned by the method getTitle(Locale l) returned the ORA-06502 error is a
    known issue. This issue actually occurs within 9iAS Portal and should be resolved in the first maintenance release scheduled
    for 9iAS Portal.
    Waiting on reply from Nilay on #1
    2) The Provider class method initSession() not propagating the array of returned cookies back to the browser is an issue that we are currently working on. This bug has been fixed for most cases in the first maintenance release. A 100% fix of this issue is still being worked on.
    3) The limit to the number of portlets you can have per provider was an issue in the Early Adopter release, but is no longer an issue with 9iAS Portal production. Upgrade to the production release and you should no longer see this problem.
    4) The error "Meta data missing for portlet ID=<number>". I have not seen or heard about others receiving this same message. For this error, can you upgrade to the production version and let me know if you still receive this error message. At that time we can check for differences within the configuration.
    Not bug, but issues......
    1) You have made a good point with the sessiontimeout parameter. The JPDK uses servlet 2.0 APIs which does not provide access to the sessiontimeout. Currently, you will need to specify the sessiontimeout parameter in the zone.properties file.
    2) This is true. Currently there is no means to check whether a ProviderUser has administrative privileges. This is on our features list for future enhancements.
    3) This is also true. The DefaultPortletPersonalizationManager was created as a default runtime for developers not used to writing portlet code. It allows developers to write portlet code without concentrating on the underlying framework. Once a developer becomes more experienced with the JPDK and portlet environment, we encourage them to create their own
    customization manager. This includes changing how the portlet repository is stored or changing how the user customization is
    handled and where it is stored. You have no limitations as long as you follow the guidelines of the PortletPersonalizationManager interface.
    I hope this information helped. Again, we appreciate and welcome this type of feedback, it helps us not only locate bugs and issues, but also helps prioritize our enhancement list.
    Sue

  • WD Java iView Creation Question/Issue - CE 7.1 EHP 1 Trial

    Hi all,
    Im posting this question here seeing as that the issue has arrised on an installation of the AS JAVA and EP shipped with CE 7.1 EHP1 Trial.
    When attempting to create an iView for a deployed custom WD Java app on the trial Portal I am taken straight to the iView template selection without being given the options for iView creation( ie. create from template, portal component or WD Java app). Is this by design ( WD Java iView creation has changed from previous Portal versions or is limited in Trial installation), is this an issue with the components shipped with the Trial or an issue on my installation only?
    Currently my only solution for deploying WD java content is to copy the actual application and paste it as Portal content which then creates a WD Proxy page with a single WD Proxy iView (that of the copy pasted WD app). This is fine for single app scenarios but becomes an issue with multiple apps on one page and drag and relate scenarios.
    Kind regards,
    Willem.

    Hi Williem
    Please check the SAP CE 7.1 EHP1 documentation for more information.
    [CE 7.1 documentation|http://help.sap.com/saphelp_nwce711/helpdata/en/44/d958673ef05f4de10000000a11466f/frameset.htm]
    [CE 7.1 iViews  |http://help.sap.com/saphelp_nwce711/helpdata/en/f5/eb51590e6a11d7b84900047582c9f7/frameset.htm]
    Hope this will helps you.
    Thanks
    Arun Jaiswal

  • Registration of Business system for the Integration Engine Java in the SLD issue

    Hi,
    We have completed the installation of PI-AEX 7.4 SR1 then we ran the below wizards successfully.
    - Configuration Wizard: PI-AEX initial setup
    - Configuration Wizard: PI Self Test for AEX
    However when we were Checking the AEX Configuration as per help.sap.com
    Check the registration of a business system for the Integration Engine Java in the SLD:
        Enter https://<host>:<port>/sld .
        Choose Start of the navigation path Business System Next navigation step Integration Engine Java <SID> Next navigation step Integration End of the navigation path.
        The pipeline URL must be: http://<host_fully_qualified>:<port>/XISOAPAdapter/MessageServlet?ximessage=true .
    More information: SAP Note 1435392
    for us the Pipeline URL is as below
    http://<host_fully_qualified>:<port>/XISOAPAdapter/MessageServlet
    and the rest " ?ximessage=true "  is not there.
    Also we ran the below wizard
    Configuration Wizard: PI Self Test for AEX
    and it finished successfully without any issue.
    Any Suggestions what could be missing.
    Thanks,
    Regard
    Ahmed Mohammed

    Hi,
    I found the below SAPNOTE which confirms that the Pipeline URL should be
    http://<host_fully_qualified>:<port>/XISOAPAdapter/MessageServlet
    1564449 - PI CTC Wrong Pipeline Url after AEX Initial Setup
    However on help.sap.com it is different.
    Any one experienced the same ?
    Regards
    Ahmed Mohammed

  • Java webservice Call - Performance Issue

    I am running a multi value database on SOLARIS 10 and have JDK 6 (Latest Patch) installed, the issue i am having it that when i initiate the below command that i have a huge delay before the java process starts and performs, can anyone shed any light on this please?
    thanks
    java -jar /sanshare/java/PickToWebServiceAndBack_2.jar "https://wrpsoat:8002/soa-infra/services/default/GetARCustomerMasterTransactionWolcenAS/GetARCustomerMasterTransactionWolcenWS""GetARCustomerMasterTransactionWolcen""60000""<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:cus='http://something.co.uk/finsim/businessobjects/accountsreceivable/1.0/customerinvoicewolcenbim' xmlns:head='http:///enterprise/common/1.0/header' xmlns:cus1='http://something.co.uk/finsim/businessobjects/accountsreceivable/1.0/customerinvoicewolcenbio'> <soapenv:Header /> <soapenv:Body> <cus:CustomerMasterTransactionWolcenGetRq> <head:HeaderRq> <head:TransactionId></head:TransactionId> <head:ComponentId>1192121</head:ComponentId> <head:TransactionName>Wolcen_ARCustomerTransaction</head:TransactionName> <head:ServiceName>CallingWebService</head:ServiceName> <head:BatchId></head:BatchId> <head:Language>EN</head:Language> <head:FileName></head:FileName> <head:FilePath></head:FilePath> <head:Source>13</head:Source> <head:Target>1</head:Target> <head:HostName>machineName</head:HostName> <head:UserName></head:UserName> <head:UserRole></head:UserRole> <head:AdminEmail></head:AdminEmail> <head:ApplicationResponsibility></head:ApplicationResponsibility> <head:ControlFileFlag></head:ControlFileFlag> <head:EODFlag>Y</head:EODFlag> <head:TimeStamp>20130116T20:53:54</head:TimeStamp> </head:HeaderRq> <cus1:GetCustomerMasterRequest> <cus1:CustomerNumber>7023R02</cus1:CustomerNumber> <cus1:SessionID>16453_75234_aljt</cus1:SessionID> </cus1:GetCustomerMasterRequest> </cus:CustomerMasterTransactionWolcenGetRq> </soapenv:Body> </soapenv:Envelope>""""/sanshare/java/soalogs/""INET-10.3.204.152-1400|16453|75234927|1|SOA.DEBTORS.ACCOUNT"

    getting alot of errors that are similar to the below any idea what they mean, im not all that clued up on solaris so not sure what these mean:
    18590/1:     0.3983     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3984     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3985     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3986     stat64("/usr/ccs/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3987     stat64("/usr/local/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3988     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3989     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3990     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3991     stat64("/usr/ccs/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3991     stat64("/usr/local/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.4025     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4029     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4031     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4032     stat64("/usr/ccs/lib/libmd.so.1", 0xFFBFD9C0)     Err#2 ENOENT
    18590/1:     0.4032     stat64("/usr/local/lib/libmd.so.1", 0xFFBFD9C0)     Err#2 ENOENT

  • [Solved] Java applications and awesome issue

    Hello Folks,
    I know this issue has been solved before, but it didn't work for me:
    You all know the issue with the grey windows when starting a java application, right? Well, I have that issue too and I'd like to bring that to work.
    I read this article   http://awesome.naquadah.org/wiki/Problems_with_Java   but the workarrounds didn't work (I didn't try the second one with wmname).
    Is there yet any other know workarround? I also tried this one but that one didn't work eighter:
    export AWT_TOOLKIT=MToolkit
    [tectu@mercur ~]$ awesome -version
    awesome v3.4.11 (Pickapart)
    • Build: Apr 27 2012 09:01:08 for x86_64 by gcc version 4.7.0 (nobody@archbuild)
    • D-Bus support: ✔
    [tectu@mercur ~]$ java -version
    java version "1.7.0_03-icedtea"
    OpenJDK Runtime Environment (IcedTea7 2.1) (ArchLinux build 7.b147_2.1-3-x86_64)
    OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)
    [tectu@mercur ~]$
    Does somebody have a working solution for me?
    ~ Tectu
    Last edited by Tectu (2012-05-24 11:21:17)

    Oh, the 'wmname LG3D' solution did work indeed.
    I was just curious about saying that I use a different window manager, that I thought I'm just gonna try the two other solutions.
    Thank you guys!

  • Java.lang.ClassNotFoundException - classloader issue ?

    Hi All
    We tried to deploy our ADF ear file to 10.3.6 weblogic.
    Our app uses 3rd party jars put in WEB-INF/lib in war which in turn is in our app ear file.
    Our web.xml is configured
       <listener>
        <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
      </listener>
    When we deploy our ear app, we get this error:
    Is this a classloader issue ? If it is, at what level of classloader this is failing ?
    What file should we configure ?
    Where should we put our third-party jars as we do not have control over the install weblogic servers owned by another team.
    Any help is appreciated.
    Sincerely
    ####<Sep 18, 2013 10:54:50 AM PDT> <Error> <Console> <host> <AdminServer> <[ACTIVE] ExecuteThread: '16' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <085fcd85a0c1669b:64c5b0f5:141284171fa:-8000-00000000000001eb> <1379526890738> <BEA-240003> <Console encountered the following error weblogic.management.DeploymentException: [Deployer:149233]An unexpected error was encountered during the deployment process.
      at weblogic.deploy.internal.targetserver.DeployHelper.handleException(DeployHelper.java:385)
      at weblogic.deploy.internal.targetserver.DeployHelper.convertThrowableForTransfer(DeployHelper.java:511)
      at weblogic.deploy.internal.targetserver.DeploymentManager.notifyCommitFailure(DeploymentManager.java:1442)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:457)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: java.lang.ClassNotFoundException: ch.qos.cal10n.MessageConveyorException
      at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
      at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
      at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
      at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:52)
      at ch.qos.cal10n.MessageConveyor.lookup(MessageConveyor.java:115)
      at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:77)
      at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:66)
      at org.jboss.weld.exceptions.WeldExceptionKeyMessage.getAsString(WeldExceptionKeyMessage.java:67)
      at org.jboss.weld.exceptions.WeldException.getMessage(WeldException.java:87)
      at org.jboss.weld.exceptions.WeldException.getLocalizedMessage(WeldException.java:82)
      at java.lang.Throwable.toString(Throwable.java:343)
      at com.bea.logging.ThrowableWrapper.<init>(ThrowableWrapper.java:26)
      at com.bea.logging.ThrowableWrapper.<init>(ThrowableWrapper.java:29)
      at com.bea.logging.BaseLogRecord.setThrown(BaseLogRecord.java:172)
      at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:100)
      at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:63)
      at weblogic.logging.JDKLoggerFactory.createBaseLogRecord(JDKLoggerFactory.java:85)
      at com.bea.logging.LoggingService.log(LoggingService.java:234)
      at weblogic.i18n.logging.Loggable.log(Loggable.java:158)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.complete(AbstractOperation.java:429)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:326)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)

    Please check if the clas ch.qos.cal10n.MessageConveyorException is available.
    check permissions.
    check if exist.
    check if the directory is into JAVA_CLASSPATH.

  • Java proxy  - http.nonProxyHosts issue

    Hi,
    I have a test code that connects to a URL. I want the local URLs to be connected without proxy server. But It ends with the following error
    C:\temp>java -Dhttp.nonProxyHosts="192.168.10.150|*.mycompany.local|localhost" ProxyTest
    Exception in thread "main" java.io.IOException: Unable to tunnel through proxy.
    Proxy returns "HTTP/1.0 403 Forbidden"
    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnec
    tion.java:1648)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
    (AbstractDelegateHttpsURLConnection.java:164)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:1172)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
    sURLConnectionImpl.java:234)
    at ProxyTest.main(ProxyTest.java:17)
    The following is my code
    import java.net.*;
    import java.io.*;
    public class ProxyTest
         public static void main(String[] args) throws Exception
              System.setProperty("nonProxyHosts", "192.168.10.150|localhost");
              Authenticator.setDefault(new ProxyAuth("pandian", "pandian"));
              URL url = new URL("https://192.168.8.150/");
              SocketAddress addr = new InetSocketAddress("192.168.8.100", 808);
              Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
              HttpURLConnection con = (HttpURLConnection) url.openConnection(proxy);
              InputStream is = con.getInputStream();
              int i=-1;
              while ((i=is.read())!=-1)
                   System.out.print((char)i);
              is.close();
    class ProxyAuth extends Authenticator
         private String user, password;
    public ProxyAuth(String user, String password) { 
    this.user = user;
    this.password = password;
    protected PasswordAuthentication getPasswordAuthentication() { 
    return new PasswordAuthentication(user, password.toCharArray());
    The same code executes for any URLs those are not blocked by the proxy server.
    Any guess?
    Edited by: user3749193 on Aug 10, 2011 2:40 AM
    Edited by: user3749193 on Aug 10, 2011 3:18 PM

    By going through your code, i could see change in only below below line:
    Present code
    >
              Authenticator.setDefault(new ProxyAuth("eguser", "egurkha"));
              URL url = new URL("http://192.168.10.100/");
    earlier Code:
    >
              Authenticator.setDefault(new ProxyAuth("eguser", "egurkha"));
              URL url = new URL("http://192.168.8.100/");
    That means still your using proxy to access the urls. And earlier you were trying to access the proxy server, by below code:
    SocketAddress addr = new InetSocketAddress("192.168.8.100", 808);
    HttpURLConnection con = (HttpURLConnection) url.openConnection(proxy);
    Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);Regarding below error, it says the site you are trying to access is not having valid certificate/ the certificate is not trusted by your truststore.
    C:\temp>java ProxyTest
    Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.val
    idator.ValidatorException: PKIX path building failed: sun.security.provider.cert
    path.SunCertPathBuilderException: unable to find valid certification path to req
    uested targetEDiting:: To Add to your trust store run the below Program
    * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *   - Redistributions of source code must retain the above copyright
    *     notice, this list of conditions and the following disclaimer.
    *   - Redistributions in binary form must reproduce the above copyright
    *     notice, this list of conditions and the following disclaimer in the
    *     documentation and/or other materials provided with the distribution.
    *   - Neither the name of Sun Microsystems nor the names of its
    *     contributors may be used to endorse or promote products derived
    *     from this software without specific prior written permission.
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    import java.io.*;
    import java.net.URL;
    import java.security.*;
    import java.security.cert.*;
    import javax.net.ssl.*;
    public class InstallCert {
        public static void main(String[] args) throws Exception {
         String host;
         int port;
         char[] passphrase;
         if ((args.length == 1) || (args.length == 2)) {
             String[] c = args[0].split(":");
             host = c[0];
             port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
             String p = (args.length == 1) ? "changeit" : args[1];
             passphrase = p.toCharArray();
         } else {
             System.out.println("Usage: java InstallCert <host>[:port] [passphrase]");
             return;
         File file = new File("jssecacerts");
         if (file.isFile() == false) {
             char SEP = File.separatorChar;
             File dir = new File(System.getProperty("java.home") + SEP
                  + "lib" + SEP + "security");
             file = new File(dir, "jssecacerts");
             if (file.isFile() == false) {
              file = new File(dir, "cacerts");
         System.out.println("Loading KeyStore " + file + "...");
         InputStream in = new FileInputStream(file);
         KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
         ks.load(in, passphrase);
         in.close();
         SSLContext context = SSLContext.getInstance("TLS");
         TrustManagerFactory tmf =
             TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
         tmf.init(ks);
         X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
         SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
         context.init(null, new TrustManager[] {tm}, null);
         SSLSocketFactory factory = context.getSocketFactory();
         System.out.println("Opening connection to " + host + ":" + port + "...");
         SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
         socket.setSoTimeout(10000);
         try {
             System.out.println("Starting SSL handshake...");
             socket.startHandshake();
             socket.close();
             System.out.println();
             System.out.println("No errors, certificate is already trusted");
         } catch (SSLException e) {
             System.out.println();
             e.printStackTrace(System.out);
         X509Certificate[] chain = tm.chain;
         if (chain == null) {
             System.out.println("Could not obtain server certificate chain");
             return;
         BufferedReader reader =
              new BufferedReader(new InputStreamReader(System.in));
         System.out.println();
         System.out.println("Server sent " + chain.length + " certificate(s):");
         System.out.println();
         MessageDigest sha1 = MessageDigest.getInstance("SHA1");
         MessageDigest md5 = MessageDigest.getInstance("MD5");
         for (int i = 0; i < chain.length; i++) {
             X509Certificate cert = chain;
         System.out.println
              (" " + (i + 1) + " Subject " + cert.getSubjectDN());
         System.out.println(" Issuer " + cert.getIssuerDN());
         sha1.update(cert.getEncoded());
         System.out.println(" sha1 " + toHexString(sha1.digest()));
         md5.update(cert.getEncoded());
         System.out.println(" md5 " + toHexString(md5.digest()));
         System.out.println();
         System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
         String line = reader.readLine().trim();
         int k;
         try {
         k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
         } catch (NumberFormatException e) {
         System.out.println("KeyStore not changed");
         return;
         X509Certificate cert = chain[k];
         String alias = host + "-" + (k + 1);
         ks.setCertificateEntry(alias, cert);
         OutputStream out = new FileOutputStream("jssecacerts");
         ks.store(out, passphrase);
         out.close();
         System.out.println();
         System.out.println(cert);
         System.out.println();
         System.out.println
              ("Added certificate to keystore 'jssecacerts' using alias '"
              + alias + "'");
    private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
    private static String toHexString(byte[] bytes) {
         StringBuilder sb = new StringBuilder(bytes.length * 3);
         for (int b : bytes) {
         b &= 0xff;
         sb.append(HEXDIGITS[b >> 4]);
         sb.append(HEXDIGITS[b & 15]);
         sb.append(' ');
         return sb.toString();
    private static class SavingTrustManager implements X509TrustManager {
         private final X509TrustManager tm;
         private X509Certificate[] chain;
         SavingTrustManager(X509TrustManager tm) {
         this.tm = tm;
         public X509Certificate[] getAcceptedIssuers() {
         throw new UnsupportedOperationException();
         public void checkClientTrusted(X509Certificate[] chain, String authType)
              throws CertificateException {
         throw new UnsupportedOperationException();
         public void checkServerTrusted(X509Certificate[] chain, String authType)
              throws CertificateException {
         this.chain = chain;
         tm.checkServerTrusted(chain, authType);
    Edited by: 833545 on Aug 12, 2011 3:32 PM

  • WebAS Java 6.4 Install issues on J2EE_CONFIGENTRY

    Hi Folks,
    I'm stuck on my install of SAP WebAS 6.4 Java on the table 2EE_CONFIGENTRY.
    SEVERE: Message: Cannot assign NULL to host variable 1. The corresponding column "CID" in table "J2EE_CONFIGENTRY" is defined as NOT NULL. The statement is "INSERT INTO "J2EE_CONFIGENTRY" ("CID","NAMEHASH","ISFILE","NAME","DTYPE","VBIGINT","VDOUBLE","VSTR","VBYTES","FBLOB") VALUES (?,?,?,?,?,?,?,?,?,?)".
    I tried Java Add on to ABAP and had this issue. I than tried a fresh Java install and got stuck at the same point again. My Linux version is 2 2.6.9-22 with saplocales-2.3.4-3 & glibc-2.3.4-2.13.
    Any help would be much appreciated.
    Regards.

    Hi
    I feel that there is some problem in the glib version ur using.Please check the SAP note : 171356 for correct glib and saplocals version for your linux OS.
    Reward suiatble points

  • Java and Batch File Issue - need urgent help

    I have a java program which calls a batch file. This batch file calls another java program. I want an option so that I can close this java program from main program.
    If i try process.destroy then it will call batch file and not java program.
    I can't go away with batch file.
    I will appreciate if someone can help me.

    khannap wrote:
    Hi, Thanks for the help but this doesn't seem solving my problem completely. I will appreciate if you can help more.
    I will explain you the scenario -
    1. There is java program provided as an external program to me.Only changes things slightly.
    2. This java program is called using batch file. When batch file is started this java program starts and listens on a socket for incoming data.I would want to wrap the launch of this java program in another JVM so we can use process.destroy().
    3. I am writing a program to check performance of the above java program. I want to call this java program from my program in a loop having some varying config data. When I run the loop first time I create a batch file at run time which executes the batch file provided by vendor. This batch file starts the socket. Once my message list is over then my loop goes to executing the batch file again with different config parameters. But this time I run into issue because my previous java program is not killed after message sending was over.Would it be acceptable to mung the 3rd party batch file to insert a wrapper JVM?
    Even if i use threads I don't think I can get rid of batch file.I did not suggest getting rid of batch files.
    So, I need to find a way so that when any iteration of loop is over then this socket program is killed. These 3rd party java programs - do they not have a "terminate" command you can put at the end of your message list?
    Even if i closed the socket from my client program that doesn't help because server is still listening and waiting for new client.
    I need to kill server which was started by batch file.On Linux it would be fairly simple to modify your batch file to determine what the process id is and send the process a signal to terminate it.
    Not sure what you can do on Windows.

  • Error Message Java App Possible Proxy Issue

    I am trying to connect to a java app throught the internet and get the following message:
    java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at javax.baja.naming.BIpHost$SocketFactory.open(BIpHost.java)
    at javax.baja.naming.BIpHost.openSocket(BIpHost.java)
    at com.tridium.fox.sys.BFoxClientConnection.connect(BFoxClientConnection.java)
    at com.tridium.fox.sys.BFoxSession.connect(BFoxSession.java)
    at com.tridium.workbench.shell.BNiagaraWbApplet.logon(BNiagaraWbApplet.java)
    at com.tridium.workbench.shell.BNiagaraWbApplet.appletStart(BNiagaraWbApplet.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at WbApplet.invoke(WbApplet.java:447)
    This is needed for work but I get this message. From home it works perfectly. My guess is our proxy is blocking something. I have no control over the proxy so I need to knw what to tell our network engineer so this can be opened if this is indeed the case.
    Thanks for any help!

    Just now I uninstalled the Sun Java Studio Creator and deleted all directories related to it, then re-installed.
    I don't know why, but It is just ok now.

  • Webutil - java bean not found issue when openning the form another time

    Hello,
    I have a form which uses webutil and is called from another form (using CALL_FORM), the code runs from the when-window-activated trigger and it works well.
    But after the form closes (EXIT_FORM), and then called again (CALL_FORM(...,HIDE) it shows a message that the file java bean was not found....
    can someone help?

    Hello,
    Maybe this comes from the HIDE parameter. Actually, the bean area have to be shown (so its visible property must be true and the canvas must be displayed) to be taken into account.
    Francois

Maybe you are looking for

  • Hard Disk Short DST: FAILED Failure ID: MC05BK-6KP​7H9-MFPWW1​-60VN03

    Hard  Disk can't be read anymore. Failure ID: MC05BK-6KP7H9-MFPWW1-60VN03 What does this ID exactly mean? I know so far that the hard disk has to be replaced. But as usual there is unsaved data to be rescued ... One year warranty by HP has expired bu

  • WS14000088 one-step Approval of contracts

    Dear SRM Friends, I have problem with finding the right approver for my workflow 14000088 one-step approval of contracts. The process is easy: My purchaser with user role: SAP_EC_BBP_PURCHASER should create the contract. Afterwards my Manager1 with u

  • CS5 (and CS4) crash upon quitting - can't understand crash report?

    I was wondering if you can tell from this crash report why Photoshop CS5 on Snow Leopard always crashes when I quit. The other CS5 programs don't have this problem, but I did have the problem with CS4. Perhaps it's a plug-in, but I removed all 3rd pa

  • Quick time issue

    I did a microsoft update 4 days ago and since then my itunes wont boot. i have found that quicktime is responsible and tried several suggestions on this message board (delete qt and itunes,reinstal and do windows install cleanup, tried task maneger a

  • Export Web Application [EXPORT] Command in WAD

    HI Gurus, Here is a strange problem. I would like a real solution because I've read just about any documentation there is out there. So, thanks for thoughtful answers in advance. We created a custom template ZZANALYSIS_PATTERN off of SAP delivered st