NullPointerException Error when loading a JPG file...

I started a new job recently and have enherited some new JAVA code. I understand most of what is going on here (with the help of several good books). I can compile the code (with this code snippit) with no errors, but I get a NullPointerException during runtime. The error comes when I try to load "images/plasticslogo.jpg". The filename and path all appear to be correct. There is a Java Package created (called images) with the image in there. I have come to the end of my resources to resolve this problem. Can anyone help???
ERROR MESSAGE:
java.lang.NullPointerException
        at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
        at lhp.LHPSplashScreen.initComponents(LHPSplashScreen.java:64)
        at lhp.LHPSplashScreen.<init>(LHPSplashScreen.java:11)
        at lhp.LHPEventViewer.main(LHPEventViewer.java:71)
END ERROR MESSAGE
private void initComponents() {
        pnlMain = new JPanel();
        lblTitle = new JLabel();
        lblVerLabel = new JLabel();
        lblVersion = new JLabel();
        lblAuthor = new JLabel();
        lblImage = new JLabel();
        getContentPane().setLayout(null);
        setBackground(java.awt.Color.white);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
        pnlMain.setLayout(null);
        pnlMain.setBackground(new java.awt.Color(255, 255, 255));
        pnlMain.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2));
        lblTitle.setFont(new java.awt.Font("Arial", 1, 18));
        lblTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTitle.setText("Line Hour Productivity");
        pnlMain.add(lblTitle);
        lblTitle.setBounds(0, 70, 200, 22);
        lblVerLabel.setFont(new java.awt.Font("Arial", 0, 12));
        lblVerLabel.setText("Version:");
        pnlMain.add(lblVerLabel);
        lblVerLabel.setBounds(3, 87, 50, 20);
        lblVersion.setFont(new java.awt.Font("Arial", 0, 12));
        pnlMain.add(lblVersion);
        lblVersion.setBounds(50, 87, 50, 20);
        lblAuthor.setFont(new java.awt.Font("Tahoma", 0, 10));
        lblAuthor.setText("Written By: Granite Services, Inc.");
        pnlMain.add(lblAuthor);
        lblAuthor.setBounds(100, 87, 156, 20);
lblImage.setIcon(new ImageIcon(getClass().getResource("images/plasticslogo.jpg")));       
        pnlMain.add(lblImage);
        lblImage.setBounds(2, 10, 198, 64);
        getContentPane().add(pnlMain);
        pnlMain.setBounds(0, 0, 256, 107);
    }

Hiwa,
Please note that the code usesClass.getResource().
This 'small change' is not necessary for a simple
resource stored in a subdirectory.Actually, if you dont add the '/' prefix, then the package name will the
prepended. i.e it would search for the image file under abc.xyz. images
package, where abc.xyz is the package name for the current class.
Javadoc for Class.getStream..
public URL getResource(String name)
Finds a resource with a given name. This method returns null if no resource with this name is found. The rules for searching resources associated with a given class are implemented by the * defining class loader of the class.
This method delegates the call to its class loader, after making these changes to the resource name: if the resource name starts with "/", it is unchanged; otherwise, the package name is prepended to the resource name after converting "." to "/". If this object was loaded by the bootstrap loader, the call is delegated to ClassLoader.getSystemResource.

Similar Messages

  • Error when loading a flat file

    Hello,
    I am trying to load a flat file into our BW for the first time.  I keep getting the error:
    Error 1 when loading external data
    Message no. RSAR234
    I have search SDN and looked at the OSS notes and have tried several suggestions, but I still cannot get the file to load.  We are currently on version 3.5.
    My transfer structure and flat file do match.
    My transfer structure for IO_MAT_ATTR has a transfer method of PSA and is laid out as follows:
    IO_MAT                      Material Number          IO_MAT
    IO_MATNM     Material Name          IO_MATNM
    IO_MAT is: CHAR 15
    IO_MATNM is: CHAR 30
    My flat file is saved as a CSV and is as follows:
    MATONE,TEA
    MATTWO,COFFEE
    My file is saved on my local PC and is not open when I try to load it.  When I attempt to preview the file in my infopackage, I get the same error there as well.
    Any suggestions would be greatly appreciated.
    Thanks
    Charla

    Hi Charla,
    Error 1 means that the system is unable to access the file. Make sure that the path is correct and also check if the data separator is correctly defined in the "external tab" of the infopackage.
    I guess the settings in the "external tab" of the infopackage have some issues.
    Bye
    Dinesh

  • Error when loading from Flat File

    I get the message below when trying to load from a flat file.  The change that I made to the Transfer Structure was to move the items.  How can I resolve? Thanks
    Error 8 when compiling the upload program: row 227, message: Data type /BIC/CCABSMMIMH1 was found in a newer ve

    hi Niten,
    check if helps
    A newer version of the data type error when loading

  • Error when loading a flat file from Application server.

    Hi,
    I am trying to load a flatfile from the application server, and I am getting the message
    Error while accessing the application server file
    Message no. RSDS_ACCESS002
    I checked for notes and found only one:
    Note 1033978 - Correction: Loading Unicode files from application server
    but we have 19 SP level, and the note says it needs 13 SP level, so I think it would not be of any help.
    does anybodie know what to do??
    thanks for the help.
    Mauricio

    Error in accessing while application server file..
    when i am trying load the data to psa
    when i am taking the file name: text-type file from app server
    plz reslove me for this problem??
    another question
    when i am saving the file with using * in the  filename in .CSV file its not saving,
    whats the reason????
    ASHOK

  • Getting a error when loading the flat file

    Hi,
    I have created a infoobject called ID and i have  a attribute name.I have assigned a data source and done the update rules.When i try to upload the flat file  i get a error.
    Error 8 when compiling the upload program: row 227, message: A newer version of data type /BIC/CCDHIO_SRPID_ATT
    I have faced this problem earlier but now i am not able to rectify it .Can someone suggest me what to do.I am working on 3.5 version.
    Thanks
    Regards
    Harish

    Hi,
    Check the Flatfile Infoobjects and in datasource structure ,It should be same order and check whther you you are ignoring header rows or not in infopackage
    Regards,
    Marasa.

  • Error while loading the WSLD file

    Hi all
    I am trying to consume a Webservice. When i try to create the Model out of the WSDL file, it says "Error while loading the WSDL file".
    Its an XI webservice, so i cannot view it from Webservice navigator.
    How could i find out that, the problem is with the Webservice or i am missing any thing
    Kindly help
    regards
    Deepu

    Hi
    I checked the log and i am getting the following exceptions
    1.DynamicProxy.TempDir=C:\DOCUME1\DEEPUM1\LOCALS~1\Temp\, DynamicProxy.INetProxy.Host=}'
         at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:413)
    Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.WebserviceClientException: GenericServiceFactory initialization problem. Could not load web service model.
    2. Caused by: com.sap.engine.lib.xml.util.NestedException: IO Exception occurred while parsing file:Invalid Response Code: (401) Unauthorized. The requested URL was:"http://Pinnacle:50000/XISOAPAdapter/MessageServlet?channel=:PowerEP_BusService:Out_SOAP_DocViewDownload" -> com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized. The requested URL
    3. java.lang.NullPointerException
         at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DOperationImpl.initParameters_DocumentStyle(DOperationImpl.java:59)
    Is this any authorization problem
    regards
    Deepu

  • Error in loading the WSDL file. Check the error log for more details

    Hello,
    I am trying to create a Import Adaptive Webservice Model. I am using the WSDL:
    http://www.abysal.com/soap/AbysalEmail.wsdl
    I am getting the below error when I choose WSDL source as UDDI or file (I am not using any logical destination)
    "Error in loading the WSDL file. Check the error log for more details."
    Where can i see the error log? And what is the solution to fix this?
    I am able to create the model if i save the wsdl locally on my machine and choose Local File System or File as the WSDL source. But at runtime this fails as the application tries to read the WSDL for metadata info and it looks into the application server for this file.
    I also tried creating the old webservice model. And it is able to create the model. But I feel I need to use the new model as this one is deprecated.
    Thanks,
    Sachin

    Hi
    For the logs you can search in this directory
    Goto Window->Show view->Other->PDE Runtim->Error Log
    please try this may it would help you out, try to create a model for you Web Service using Web Service Model (DEPRECATED)
    See this link:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ep/integration%2bof%2bweb%2bservices%2b-%2bdifferent%2bscenarios

  • Error in loading the WSDL file

    hi
    when i am creating a Adaptive Webservice model with the sneak preview 2004s
    while Choosing the published service from UDDI
    i am getting and error called
    "Error in loading the WSDL file"
    i have gone through the log files it basically saying that
    Caused by: java.io.IOException: Cannot connect to http://192.168.1.69:50100/QuickCarRentalService/Config1?wsdl, passing via http proxy: :80: Connection refused: connect
    but i am not using any proxy server
    what all changes i need to do in proxy server settings
    Regards
    JM

    Hi John,
    For changing the Proxy Settings in NWDS.
    Navigate to Window --> Preferences.
    Under Work Bench, Select Proxy Settings.
    There is a Check box saying "Use Proxy Sever", uncheck this one;
    and try imprting you WSDL file again.
    Hope it helps.
    Regards,
    Alka.

  • Error when loading XSLT mapping of the application

    Hi,
    I am using XSLT mapping in XI.
    It is working ok when I test it in Interface Mapping but it gives below error when I test end to end scenario.
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">TRANSFORMER_CONF_EX</SAP:Code>
      <SAP:P1>com/cba/***.xsl</SAP:P1>
      <SAP:P2>urn:**:**</SAP:P2>
      <SAP:P3>450326d0-1559-11dd-99a1-d89c0a0a380b</SAP:P3>
      <SAP:P4>-1</SAP:P4>
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when loading XSLT mapping of the application</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Yes, I have activated it
    Regards,
    Anirudh.

    hi
    please assure that if you save your xslt stylesheet locally, that it is saved in UTF-8 format, before you import it.
    Pls do export the imported archive as a zip file to your local disk and try opening the same. If its not then the zip file which you have uploaded might have got corrupted/is not fully uploaded.
    Try activating the imported archive and do a check before you do that. This you can do with a minor change in the description or so.
    reward points if found helpfull
    regards
    chandra.k

  • Error -5000 and: Error when loading the transcode setting

    For a couple of days I've been trying to export my project on a DVD, but on the half way of the transcoding it comes the Error -5000, and then there is such a message, something about the navigation, can't be found etc... I work on a mac OS X, using Encore CS3, all my data I've got on my external harddisk, with space of 80 GB.
    Besides, when I'm trying to export my project on a blu-ray disc, there comes a message: Error when loading the transcode setting! I know that there are only two codecs there - H.264 and MPEG-2, and there are only MPEG-2 movie files there, so I set the MPEG-2 codec. And there comes such a thing! Having set the H.264, there comes the same. What can it be?
    And the last one is the copy protection. I know that it can be activated, with CGMS and Macrovision, only if the CSS option is set on "permit no copies". So I do, and then there comes a message - "for these settings there is no copy protection provided". So what now to do?

    My flash drive PNY comes up with error -5000 and i do not know what to do can you help me with this problems

  • JAVAMAP-Sax Parser ...............Linkage error when loading the class.

    Dear all,
    Do we have any extra things to execute the Java mapping using the Sax Parser?
    When I am executing the interface mapping ,I am getting the" Linkage error when loading the class" error.
    Kindly let me know your personnel maildId so that I can mail you the screen shots.
    Thanks,
    Srinivasa

    Dear sunil,
    Find the File.
    Source:
    <MTO_FTP_MAT_DETAILS>
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    TARGET
    MTI_FTP_MAT_DETAILS
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    Source:
    <MTO_FTP_MAT_DETAILS>
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    TARGET
    MTI_FTP_MAT_DETAILS
    <MATDETAILS>
    <MAKTX>
    <MATNR>
    <WERKS>
    <LABST>
    <MEINS>
    <PERCNT>
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import com.sap.aii.mapping.api.StreamTransformation;
    class Echo {
    public static OutputStream out;
    public class myEcho extends DefaultHandler implements StreamTransformation {
    private Map map;
    public void setParameter(Map param) {
    map = param;
    public void execute(InputStream in, OutputStream out) {
    DefaultHandler handler = this;
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    SAXParser saxParser = factory.newSAXParser();
    Echo.out = out;
    saxParser.parse(in, handler);
    } catch (Throwable t) {
    t.printStackTrace();
    public void startDocument() throws SAXException {
    try {
    Echo.out.write("<?xml version='1.0' encoding='UTF-8'?>".getBytes());
    } catch (IOException e) {
    e.notify();
    public void endDocument() throws SAXException {
    try {
    Echo.out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    public void startElement(String namespaceURI, String sName, // simple name
    String qName, // qualified name
    Attributes attrs) throws SAXException {
    String eName = sName; // element name
    if ("".equals(eName))
    eName = qName; // not namespace-aware
    if ("ns0:MTO_SAP_MAT_DETAILS".equals(qName)) {
    try {
    Echo.out.write(("<MTI_FTP_MAT_DETAILS>").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    } else {
    try {
    Echo.out.write(("<" + qName + ">").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    public void endElement(String namespaceURI, String sName, // simple name
    String qName // qualified name
    ) throws SAXException {
    String eName = sName; // element name
    if ("".equals(eName))
    eName = qName; // not namespace-aware
    if ("ns0:MTO_SAP_MAT_DETAILS".equals(qName)) {
    try {
    Echo.out.write(("</MTI_FTP_MAT_DETAILS>").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    } else {
    try {
    Echo.out.write(("</" + qName + ">").getBytes());
    } catch (Exception e) {
    e.printStackTrace();
    public void characters(char buf[], int offset, int len)
    throws SAXException {
    String s = new String(buf, offset, len);
    try {
    Echo.out.write(s.getBytes());
    } catch (Exception e) {
    e.printStackTrace();

  • Report Designer - Error when Loading Report

    Hi,
    We have created a report in Report Designer (7.0) and saved it. When we execute it runs fine. After closing the report and trying to reopen it, the report does not open. It gives an error "Error when Loading Report". Our BI frontend patch is 14.
    Did anyone encounter this issue and is there a solution to this.
    Thanks
    Hemant

    Hello,
    Please go to SE38 -> RS_REPORT_MAINTAIN,
    Type your report name, and DT als "Report Type".
    Goto edit mode, copy&paste this XML into txt file and send it to me ([email protected]). I will check whats going on with this report. Loading should be always possible.
    Regards, Karol Kalisz, BI Development

  • Error in loading a jpeg file using webutil

    I´m using webutil with forms9i and got errors when loadin g jpeg files. I selected some files and worked ok. Some files (ones with blank characters inside their names) blow up the form.
    The resultant error message is:
    FRM-92102:a network error has occurred. The Forms Client has attempted to reestablish its connection to the server1 time(s) without success. Please check the network connection and try again later.
    Details...
    Java Exception:
    java.io.IOException: Negative or zero content-length from server
    at oracle.forms.netHTTPNStream.doFlush(Unknown Source)
    at oracle.forms.netHTTPNStream.flush(Unknown Source)
    at javaio.DataOusputStream.flush(Unknown Source)
    at oracle.forms.net.StreamMessageWriter.run(Unknown Source)
    Do you have any info about this error?

    It would help if you mentioned which bit of file transfer you are doing there are about 8 different options..
    For instance I tried Clint_to_AS with a file name containing a space and all was OK.
    webutil_file_transfer.client_to_as('d:\temp\a file.txt','d:\temp\foo.txt',false, null);

  • ORA-00054 error when loading Oracle table using Data Services

    Hello,
    we are facing ORA-00054 error when loading Oracle table using BO Data services
    (Oracle 10g database, BODS Xi 3.2 SP3)
    Test Job performs
    1- truncate table
    2- load table (tested in standard and bulk load modes)
    Scenario when issue happens is:
    1- Run loading Job
    2- Job end in error for any Oracle data base error
    3- When re-running the same Job, Job fails with following error
         ORA-00054: resource busy and acquire with NOWAIT specified
    It seems after first failure, Oracle session for loading the table stays active and locks the table.
    To be able to rerun the Job, we are forced need to kill Oracle session manually to be able to run the Job again.
    Expected behaviour would be : on error rollback modifications made on table and BODS stops Oracle session in a clean way.
    Can somebody tell me / or point me to any BODS best practice about Oracle error handling to prevent such case?
    Thanks in advance
    Paul-Marie

    the ora-0054 can occure depending how the job failed before. If this occures you will need the DBA to release the lock on the table in question
    Or
           AL_Engine.exe on The server it creates the Lock. Need to Kill Them. Or stop it..
    This Problem Occurs when we select The Bulkloading Option in orclae  We also faced the same issue,Our admin has Killed the session. Then everything alright.

  • Error while loading CSV Flat file

    Hi,
    I am getting the following errors while loading a flat file into the DataSource:
    1. Error 'Unit CS is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field UNIT record 1, value CS)
    2. Error 'The argument '9,018.00' cannot be interpreted as anumber' on assignment field /BIC/ZTVSA record 1 value 9,018.00
    What can I do to correct this?
    Thanks

    I am taking the following (Headers) fields in this order in a CSV file :
    0LOGSYS     ,0MATERIAL,0UNIT,0BASE_UOM,0COMP_CODE,0PLANT,0FISCPER,0FISCVARNT,
    0CURRENCY,0PRICE_TYPE,ZTVSAKF,ZVOTVSKF,0PRICE_CTRL,ZPRICE_STKF,0PRICE_BASE,
    0VAL_CLASS,0CURTYPE,0VALUATION
    I have added all these fields in the DataSource as well. T-Code CUNIT has CS as a Unit. 
    I deleted and recreated the DataSource and am getting this error now:
    Error 'Unit CS is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field UNIT record 1, value CS)
    Error 'The argument '1,398.00' cannot be interpreted asa number' on assignment field /BIC/ZTVSAKF record 1 value 1,398.00
    Error 'The argument '8,10.00' cannot be interpreted as anumber' on assignment field /BIC/ZTVSKF record 1 value 8,10.00
    Error 'Unit 0 is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field BASE_UOM record 1, value )
    Error 'Unit CS is not created in language EN...' at conversion exit CONVERSION_EXIT_CUNIT_INPUT (field UNIT record 1, value CS)
    Error 'The argument '5,50.00' cannot be interpreted as anumber' on assignment field /BIC/ZTVSAKF record 1 value 5,50.00
    Does it matter what order the columns are in?

Maybe you are looking for

  • Built in iSight is no longer working after hard drive was replaced

    I have a 2008 MacBook Pro that has served me well up until recently. I had my hard drive replaced about a week ago and now I've noticed that my built in iSight is no longer working. It doesn't work with any application or on any user. The green light

  • Downloading OS 5.0.1 and I keep getting a (-5000) error message

    I am trying to update my iPhone 4 to the OS 5.0.1 and I get this error message... "An error occurred while backing up this iPhone (-5000).  Would you like to continue to update this iPhone?  Continuing will result in the loss of all contents on this

  • How do I drag clips to a bin?

    All of a sudden I did the updates and I can't drag clips from my timeline to a bin? Help? Creative Cloud Subscription

  • Attachments are not completely downloading

    All of a sudden when I tap to download an attachment it will not completly download and therefore not open.  What can I do to correct this.  I've done numourious battery pulls and it has not helped :-(

  • HELP With Crash Report

    I inadvertantly Posted in the G5 Fourm. Can anyone decipher this (Safari wouldn't launch even after logging out/in and trashing safari.plist, it kernal paniced when I was submitting a report to apple): PS: Firefox workes great even when Safari decide