IOException while trying to access an URL with BasicAuthentication

Well, that's it.
The piece of code is this:
URL url = new URL("http://user:pass@server/somepage.xml");
url.openStream()The code works fine if I use any other URL without BasicAuthentication.
Is there any tutorial or help on how I should handle this?
Thanks!

Hi mateamargo,
To access resources protected by HTTP basic authentication, you need to use java.net.Authenticator. Two steps. First you extends java.net.Authenticator, such as:
    class MyAuthenticator extends Authenticator {
        public PasswordAuthentication getPasswordAuthentication () {
            return new PasswordAuthentication ("user", "pass".toCharArray());
    }then tell JDK's HTTP module to use it:
    MyAuthenticator authinstance = ...
    Authenticator.setDefault (authinstance);And you should be all set. For more details, please check:
http://java.sun.com/javase/6/docs/technotes/guides/net/http-auth.html
Regards,
Edward

Similar Messages

  • :: Error : While trying to access the URL through the Apache ::

    Hello,
    We are getting following error after starting the apache in the file <sid>_error_log
    [20/Apr/2009:10:49:04] [Error] SiteMinder Agent
            Failed to initialize the message bus.
    [20/Apr/2009:10:49:04] [Warning] SiteMinder Agent
            SiteMinder agent has encountered initialization errors and will not service requests.
    And while accessing the portal we are getting following error
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, www@ep-<sid>.al.sw.ericsson.se and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Apache/2.0.59 HP-UX_Apache-based_Web_Server (Unix) mod_perl/1.99_16 Perl/v5.8.8 DAV/2 mod_ssl/2.0.59 OpenSSL/0.9.8d Server at ep-<sid>.al.sw.ericsson.se Port 443
    All the config files seems to be okay.
    And on the same Server we have another apache of other system.
    But its down still we are facing above issue.
    Kindly help
    Thank you , Regards,
    Girish

    Hi Girish,
    Do you find out the solution to this issue? We having a similar issue with our Enterprise Portal using Apache and Siteminder Agent?

  • An error occured while trying to access the service

    i'm continually having issues with trying to convert my files from PDF to excel.  I keep on getting the error message "An error occured while trying to access the service" with no real explanation as to what is wrong.  I've tried several times on several different computers, logging on and off, changing users...same message everytime.  I have a time sensitive project to complete, and can't get it done if this conversion can't be done.  HELP!

    Hi J,
    Here are a couple documents that may assist you:
    'Getting started' guide
    FAQ
    Let me know if those help!
    Kindest regards, Stacy

  • I am using Adobe Reader with paid up service through May 2015.  When I attempt to convert a file from PDF or to PDF, I get the message "An error occured while trying to access the service.  What do I need to do to access the service paid for?

    I am using Adobe Reader with paid up service through May 2015.  When I attempt to convert a file either to PDF or from PDF, I get the error message, "An error occurred while trying to access the service".  What do I need to do to get access to the service I have paid for?

    Hi DeaconTomColorado,
    Please see "Error occurred when trying to access this service" when logging on to Acrobat.com.
    Adobe has just released an update to Adobe Reader, so if you're accessing the service via Reader, please let us know whether the update helps resolve the issue.
    Best,
    Sara

  • I am trying to convert PDF to word. With my PC  I get a message  "Error occurred while trying to access the service.   It worked fine for a long time.  Has been doing this for days now with all files i try to convert.

    I am trying to convert PDF to Word with Adobe Export PDF on my PC.  I get the message " error occurred while trying to access service".  Has worked fine in past.  Has been doing this for a few days now on all files i try to convert.    Any ideas?? Thanks

    Hi bert090909,
    Are you trying to convert your files from within Adobe Reader? If so, please make sure that you have the most current version by choosing Help > Check for Updates. Earlier versions of Reader could cause the specific error that you're reporting.
    Please let us know how it goes.
    Best,
    Sara

  • Java error when trying to access EAS Console with a URL.

    Hi all,
    Trying to access EAS Console with the URL but getting an JAVA error
    And it asks
    Block potentially unsafe components from being run?(recommended)
    Yes No
    Thanks

    What is your Java and EAS versions? Have you checked the supported platform matrices to confirm you have compatible versions?
    http://www.oracle.com/technetwork/middleware/bi-foundation/hyperion-supported-platforms-085957.html
    Cheers,
    Mehmet

  • MSS error while trying to access Adobe forms

    Hi all
    We are using EP 7 sp14. Delpoyed ESS/MSS BP SP 14. while trying to access certain functionalities in MSS which make use if standerd Adobe interactive forme through portal its coming up with the following error.
    com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.
    I had done few settings in Visual Admin in
    1. server >services>web services security>web services clients>sap.com>tcwdpdfobject>com.sap.tc.webdynpro.adsproxy.Adsproxy*configPort_Document.
    2. In default URL gave : http://portalserver:port/AdobeDocumentServices/Config
    3. Authentication:Basic Authentication : gave username:ADSUSERpwd which is set in the backend.
    4. In Deploy stopped and started the application.
    Also in Destinations -> Created a new HTTP and set the URL pointing to the backend.
    Is there any additional configuration to be set on the Portal side.
    Regards,
    Sasha.

    Got corrected with changing data-type for a property in the definition file.

  • Error occurred while trying to access framework

    Did some changes to master rule collection u2013 switched from default desktop to light desktop u2013 and when trying to go back, something went wrong!!!
    Error occurred while trying to access framework page: "pcd:portal_content/com.sap.pct/every_user/general/defaultAjaxframeworkContent/com.sap.portal.afpDesktop/frameworkPages/com.sap.portal.AFPpage",The object does not exist or you are not authorized to access it.If this problem persists, contact your system administrator.
    Activated SAP* user and logged in, but still the same issue!
    Tried also the following url
    http://myhost:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fevery_user!2fgeneral!2fcom.sap.portal.frameworkpage
    with the response:
    Error component failed , reason : Access is denied: pcd:portal_content/com.sap.pct/every_user/general/com.sap.portal.frameworkpage - user: Guest, Original Exception : Access is denied: pcd:portal_content/com.sap.pct/every_user/general/com.sap.portal.frameworkpage - user: Guest,
    What next to do?

    Dear Customer,
    Try to access the Default Framework using the following paterns:
    Default framework page: /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fevery_user!2fgeneral!2fcom.sap.portal.frameworkpage
    Desktop & Display rules: /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fadministrator!2fsystem_admin!2fsystem_admin_role!2fcom.sap.portal.system_admin_ws!2fcom.sap.portal.themes!2fcom.sap.portal.portalDisplayRules
    This can be used whenever the desktop assignment to the user which you are logging on with has been removed somehow. If this occurs, the user won't be able to see any content after logging on to the portal and the following error will be shown: "Error occurred while trying to access desktop: "portal_content/themes/sap_chrome". The object does not exist or you are not authorized to access it. If this problem persists, contact your system administrator."
               If this occurs, you can use the address above to restore the desktop rules at least for your user so that you can log on to the portal again with no problems.
    Best Regards,
    Fabio Sarmento

  • While trying to change a BOM with transaction CS02, a runtime error appears

    While trying to change a BOM with transaction CS02, a runtime error appears.
    In intial screen he entered material ,plant BOM usage and date valid from  after executed then id displayed item list in that he wantu2019s delete one item, he has been deleted selected item after that when he was saving he is getting runtime error
    Developer trace
    ABAP Program SAPLKED1_WRITE_CE4_BPS1                 .
    Source LKED1_WRITE_CE4_BPS1U01                  Line 30.
    Error Code SAPSQL_ARRAY_INSERT_DUPREC.
    Module  $Id: //bas/640_REL/src/krn/runt/absapsql.c#17 $ SAP.
    Function HandleRsqlErrors Line 775.
    RABAX: level LEV_RX_STDERR completed.
    RABAX: level LEV_RX_RFC_ERROR entered.
    RABAX: level LEV_RX_RFC_ERROR completed.
    RABAX: level LEV_RX_RFC_CLOSE entered.
    RABAX: level LEV_RX_RFC_CLOSE completed.
    RABAX: level LEV_RX_IMC_ERROR entered.
    RABAX: level LEV_RX_IMC_ERROR completed.
    RABAX: level LEV_RX_DATASET_CLOSE entered.
    RABAX: level LEV_RX_DATASET_CLOSE completed.
    RABAX: level LEV_RX_RESET_SHMLOCKS entered.
    RABAX: level LEV_RX_RESET_SHMLOCKS completed.
    RABAX: level LEV_RX_ERROR_SAVE entered.
    RABAX: level LEV_RX_ERROR_SAVE completed.
    RABAX: level LEV_RX_ERROR_TPDA entered.
    RABAX: level LEV_RX_ERROR_TPDA completed.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI entered.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI completed.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP entered.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP completed.
    RABAX: level LEV_RX_END entered.
    RABAX: level LEV_RX_END completed.
    RABAX: end RX_RFC
    In sm21
    Perform rollback
    Run-time error "SAPSQL_ARRAY_INSERT_DUPREC" occurred
         Short dump "090618 110101 donalda 11557 " generated
    Runtime Error          SAPSQL_ARRAY_INSERT_DUPREC
    Exception              CX_SY_OPEN_SQL_DB
           Occurred on     18.06.2009 at   11:01:01
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKED1_WRITE_CE4_BPS1" had to be terminated because
    one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "RKE_WRITE_CE4__BPS1" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    How to correct the error
    The exception must either be prevented, caught within the procedure
    "RKE_WRITE_CE4__BPS1"
    "(FUNCTION)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    Use an ABAP/4 Open SQL array insert only if you are sure that none of
    the records passed already exists in the database.
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "SAPSQL_ARRAY_INSERT_DUPREC" CX_SY_OPEN_SQL_DBC
    "SAPLKED1_WRITE_CE4_BPS1" or "LKED1_WRITE_CE4_BPS1U01"
    "RKE_WRITE_CE4__BPS1"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    3. If the programs are your own programs or modified SAP programs,
       supply the source code.
       To do this, you can either use the "PRINT" command in the editor or
       print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error occurred
       or which actions and input led to the error.

    Hi ,
    you are getting beacuse u are trying to do mass update to database.
    Please check that below note are applicable to your system.
    Note 453313 - DBIF_RSQL_ERROR_INTERNAL for mass insert
    Note 869534 - AFS MRP doesn't work properly with all BOM item categories
    Thanks Rishi Abrol

  • An error occurred while trying to access the service?

    I'm trying to convert a PDF into Excel but I get the message 'an error occurred while trying to access the service'.
    I have tried logging into my Adobe account online and doing it within there, but once I have exported the file and pressed 'convert' it simply says 'conversion failure' with no explanation.
    My subscription is still valid, so I don't see why the problems?  Has anyone else had this issue and managed to fix it?  I get the error message regardless of whether I'm trying to convert to Word or Excel.
    Any ideas greatly appreciated!!
    Thanks
    Sophie

    Hi SHurcs,
    I'm sorry that you're having such trouble with your ExportPDF subscription. Does this error occur for one particular file, or with any file that you try to convert? What operating system and browser are you using?
    To get us started, here are a few things that you can try:
    In Reader, sign out, and then sign back in.
    Use a supported web browser:  http://www.adobe.com/acom/systemreqs/
    Clear the browser cache.
    If you're using a networked computer, make sure that there are no firewall/proxy settings that prevent you from uploading files to the Internet.
    Make sure that the files you're trying to convert are within the file-size limits for ExportPDF (100 MB).
    If the problem persists, please let us know, and tell us a bit more about the files that you're converting.
    Best,
    Sara

  • "error while trying to access the service"

    I am trying to convert a pdf file to an excel file.  I get a completely unhelpful message that says  "error while trying to access the service" .
    What does this mean and how do i fix it?

    Hi sd433m,
    Thank you for posting on the Adobe forums. If you are already subscribed to the service, kindly try the steps mentioned below.
    1) Open Adobe Reader  Edit>preferences
    2) Go to Adobe Online services>change the email address to the one you have subscribed the service with
    3) Go to identity> change the email address there as well
    4) Click OK
    5) Restart the Adobe Reader and try to access the service again.
    If you have not subscribed to the service please do that as, we do not offer trial for Create PDF.
    Thanks,
    Vikrantt Singh

  • While trying to access  i phone through pc (windows 7 ) showing error 'you do not have permission to access this device '

    while trying to access  i phone through pc (windows 7 ) showing error 'you do not have permission to access this device '
    And while trying  to unlock screen after lock , slide not working 'slide to unlock'

    Hello there, charialji.
    The following Knowledge Base article offers some great steps for troubleshooting your issue:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/ts3281
    Resolution
    If a single application is not responding or stops responding when it opens, you can force it to close.
    If the device is unresponsive or if certain controls aren't working as expected, restart your device.
    If the device remains unresponsive or does not turn on (or power on), reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let it charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged. Learn more about charging iPhone and iPod touch, or iPad.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more aboutrestoring iOS software.
    If the device doesn't appear in iTunes, try to force the device into recovery mode, and then restore it.
    If the above steps do not resolve the issue, contact Apple.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I keep getting the message"an error occurred while trying to access the service".  does anyone know what i need to do to resolve this problem.  I am trying to convert apdf file for msword?

    I keep getting the message"an error occurred while trying to access the service".  does anyone know what i need to do to resolve this problem.  I am trying to convert a PDF file for ms word?

    Adobe Reader is free; but you may have paid for the ExportPDF service.
    Contact Adobe Customer Care and click on the Still need help? button to chat with an agent.
    [topic moved to ExportPDF forum]

  • An error occurred while trying to access the audit log

    Hi I have run Set-Mailbox ian.shapton -AuditOwner Update, Move, MoveToDeletedItems, SoftDelete, HardDelete
    I then created and deleted an email and ran Search-MailboxAuditLog -Identity "ian shapton" -LogonTypes Owner -StartDate "12/21/2014 12:00" -EndDate "12/21/2014 13:00" -ShowDetails
    I see An error occurred while trying to access the audit log. For more details, see the inner exception.
        + CategoryInfo          : NotSpecified: (:) [Search-MailboxAuditLog], AuditLogException
        + FullyQualifiedErrorId : [Server=Mailbox01,RequestId=07f17915-f25d-4fd5-b23e-f07a2482f4a4,TimeStamp=21/12/2014 16:45:39] [FailureCategory=Cmdlet-AuditLogException] 255D6156,Microsoft.Exchange.Management.SystemConfigurationTasks.SearchMailboxAuditLog
    MSExchange CmdletLogs shows Microsoft.Exchange.Data.ApplicationLogic.AuditLogServiceException: The Exchange Web Service returned an error while trying to access the audit log. Reason: 'Error','ErrorTimeoutExpired','The search operation could
    not be completed within the allotted time limit. Please try to narrow down your scope to reduce the result set.'.
    I am a Recipient Admin and Org Admin and can search other mailboxes using -LogonTypes Delegate
    Any idea what I am missing here?
    shapi

    Hi,
    I have the same problem when I run the Search-MailboxAuditLog command.  It has been working for 2 weeks but suddenly after moving databases from one datacenter to another and back again it stopped working.  The account running the command
    is in all necessary roles needed.
    This is what I have tested after it stopped working:
    - Search-MailboxAuditLog -Identity "xxxxxxx" -LogonTypes Delegate -StartDate (Get-Date).Adddays(-1) = Works
    - Search-MailboxAuditLog -Identity "xxxxxxx" -LogonTypes Delegate -StartDate (Get-Date).Adddays(-1) -showdetails = does not work and comes with an error.
    "The Exchange Web Service returned an error while trying to access the audit log. Reason: 'Error','ErrorTimeoutExpired',
    'The search operation could not be completed within the allotted time limit. 
    Please try to narrow down your scope to reduce the result set.'."
    This is very bad for us because we use a lot of shared mailboxes with delegates and want to report delegate action on these mailboxes.
    Environment:
    - 3 datacenters
    - Exchange 2013 CU7
    Thorir
    thorir

  • "An error occurred while trying to access the service" - Even after I have signed into Adobe reader

    I have signed into adobe reader and I am trying to convert a PDF to a word document. All I get every time is, "An error occurred while trying to access the service" My account is active and paid for. Please help me with this. I have tried a number of different documents. I pay to use this service!

    Thank you for your quik reply.
    Please try to login at https://exportpdf.acrobat.com/signin.html with your Adobe ID and password.  Please let me know this web UI does not work.
    Thank you again
    Hisami

Maybe you are looking for

  • Xml parsing using java DefaultHandler of org.xml.sax.helpers.DefaultHandler

    i am using org.xml.sax.helpers.DefaultHandler api for parsing xml file ,while parsing i am getting exception sometimes , i am using code below to parse the element and then store it to vectore parser truncate the charaacters sometimes like parsing st

  • BNR LIst

    Hi, How can I see pending BNR list which is reflected in B/S?? and I also want to take a G/L,Vendor and Customer report in DEBIT AND CREDIT column base.(i.e debit amt and credit amt in signal report)

  • What does it mean when a file with a question mark on it thats blinking mean

    I need help

  • Multiple Key Bindings

    Hello, I have a Edit -> Delete menu item. I have set an acclerator Ctrl+D on it. I want to detect the "Delete" key as well and be able to invoke the Edit-> Delete functionality. Is it possible? I have looked into the documentation which explains abou

  • FRUSTRATION with ipod update

    I have tried and tried to up date my iPod with no success and am now on the verge of tears trying to figure out what to do. I can't re-install my iTunes with the cd I received with my iPod because it says that a newer version is installed, but I can'