Results 1 to 9 of 9
  1. #1
    santunez is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default Help with compilation

    Hello

    I'm new to programming in java, and I spent a. Class I had to edit with Cavaj to see the code.

    At compile time, I get errors

    Building sample class
    javac: file not found: echo (The system cannot find the file specified)
    Building sample class
    GenerateDevices.java:69: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    cellPhoneModels.add(NonParsedFile.substring(NonPar sedFile.in
    dexOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:73: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    vendors.add(NonParsedFile.substring(NonParsedFile. indexOf(".
    ") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:77: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    computerModels.add(NonParsedFile.substring(NonPars edFile.ind
    exOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:89: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Computer");
    ^
    GenerateDevices.java:90: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Cell Phone");
    ^
    GenerateDevices.java:92: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("1");
    ^
    GenerateDevices.java:93: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("2 Phone");
    ^
    GenerateDevices.java:147: warning: [unchecked] unchecked call to add(E) as a mem
    ber of the raw type java.util.Vector
    Devices.add(phys_device_val);
    ^
    GenerateDevices.java:159: incompatible types
    found : int
    required: java.lang.String
    String test = parseer;
    ^
    1 error
    8 warnings

    --------------------------------------------------------------------------

    You can get your help to know because it gives these errors

    Best Regards

    Sebastian Antunez
    Chile

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    it seems you forgotten to import some packages. to be sure what's wrong please post your code. thx.

  3. #3
    santunez is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    package com.ca.lah;

    import com.netegrity.imapi.LogicalAttributeAdapter;
    import com.netegrity.imapi.LogicalAttributeContext;
    import java.io.*;
    import java.util.Hashtable;
    import java.util.Vector;
    import java.util.*;
    import java.lang.String;
    import java.lang.*;

    public class GenerateDevices extends LogicalAttributeAdapter
    {

    private final String LOGICAL_ATTRIBUTE_SERIAL_NUMBER = "SerialNumber";
    private final String LOGICAL_ATTRIBUTE_ESN_NUMBER = "ESNNumber";
    private final String LOGICAL_ATTRIBUTE_VENDOR_NAME = "VendorName";
    private final String LOGICAL_ATTRIBUTE_VENDOR_NAME_LIST = "VendorNameList";
    private final String LOGICAL_ATTRIBUTE_DEVICE_TYPE = "DeviceType";
    private final String LOGICAL_ATTRIBUTE_DEVICE_TYPE_LIST = "DeviceTypeList";
    private final String LOGICAL_ATTRIBUTE_DEVICE_MODEL = "DeviceModel";
    private final String LOGICAL_ATTRIBUTE_DEVICE_ASSET_TAG = "AssetTag";
    private final String LOGICAL_ATTRIBUTE_DEVICE_DESCRIPTION = "DeviceDescription";
    private final String PHYSICAL_ATTRIBUTE_DEVICES = "Devices";
    private final String PHYSICAL_ATTRIBUTE_TEMP = "TempAttr";
    private Vector cellPhoneModels;
    private Vector vendors;
    private Vector computerModels;
    private Vector devicetype;
    private BufferedReader inFile;
    private String NonParsedFile;
    private String DEVICES_FILE;

    public GenerateDevices()
    {
    }

    public void init(Hashtable imeProperties)
    throws Exception
    {
    DEVICES_FILE = (String)imeProperties.get("DEVICES_FILE");
    }

    public void initializeOptionList(LogicalAttributeContext attrContext)
    throws Exception
    {
    cellPhoneModels = new Vector();
    vendors = new Vector();
    computerModels = new Vector();
    Vector CellPhoneModels = new Vector();
    com.netegrity.llsdk6.imsapi.provider.UserProvider provAccessor = attrContext.getUserProvider();
    File inputFile = new File(DEVICES_FILE);
    try
    {
    inFile = new BufferedReader(new FileReader(DEVICES_FILE));
    }
    catch(FileNotFoundException fne)
    {
    System.out.println(fne.getMessage());
    }
    try
    {
    for(NonParsedFile = inFile.readLine(); NonParsedFile != null; NonParsedFile = inFile.readLine())
    {
    if(NonParsedFile.indexOf("CellPhone.") >= 0)
    {
    cellPhoneModels.add(NonParsedFile.substring(NonPar sedFile.indexOf(".") + 1, NonParsedFile.length()));
    } else
    if(NonParsedFile.indexOf("Vendor.") >= 0)
    {
    vendors.add(NonParsedFile.substring(NonParsedFile. indexOf(".") + 1, NonParsedFile.length()));
    } else
    if(NonParsedFile.indexOf("ComputerModel.") >= 0)
    {
    computerModels.add(NonParsedFile.substring(NonPars edFile.indexOf(".") + 1, NonParsedFile.length()));
    }
    }

    }
    catch(Exception e)
    {
    System.out.println(e.getMessage());
    inFile.close();
    }
    inFile.close();
    Vector deviceType = new Vector();
    deviceType.add("Computer");
    deviceType.add("Cell Phone");
    Vector test = new Vector();
    test.add("1");
    test.add("2 Phone");
    String log_Device_Type = attrContext.getLogicalAttributeName("DeviceTypeLis t");
    logDebugMessage("initializeOptionList:: " + log_Device_Type, true);
    attrContext.setLogicalAttributeMultiValue(log_Devi ce_Type, deviceType);
    String log_Vendor_Name = attrContext.getLogicalAttributeName("VendorNameLis t");
    logDebugMessage("initializeOptionList:: " + log_Vendor_Name, true);
    attrContext.setLogicalAttributeMultiValue(log_Vend or_Name, test);
    devicetype = deviceType;
    }

    public void toLogical(LogicalAttributeContext logicalattributecontext)
    throws Exception
    {
    String log_Asset_Tag = logicalattributecontext.getLogicalAttributeName("A ssetTag");
    String log_Serial_Number = logicalattributecontext.getLogicalAttributeName("S erialNumber");
    String log_Esn_Number = logicalattributecontext.getLogicalAttributeName("E SNNumber");
    String log_Vendor_Name = logicalattributecontext.getLogicalAttributeName("V endorName");
    String log_Device_Type = logicalattributecontext.getLogicalAttributeName("D eviceType");
    String log_Device_Model = logicalattributecontext.getLogicalAttributeName("D eviceModel");
    String log_Device_Description = logicalattributecontext.getLogicalAttributeName("D eviceDescription");
    String phys_Devices = logicalattributecontext.getPhysicalAttributeName(" Devices");
    Vector phys_Devices_val = logicalattributecontext.getPhysicalAttributeMultiV alue(phys_Devices);
    logicalattributecontext.setLogicalAttributeValue(l og_Asset_Tag, "CHANGE ME");
    logicalattributecontext.setLogicalAttributeValue(l og_Serial_Number, "CHANGE ME");
    logDebugMessage("To logical: test test", false);
    }

    public void toPhysical(LogicalAttributeContext logicalattributecontext)
    throws Exception
    {
    Vector Devices = new Vector();
    String log_Asset_Tag = logicalattributecontext.getLogicalAttributeName("A ssetTag");
    String log_Serial_Number = logicalattributecontext.getLogicalAttributeName("S erialNumber");
    String log_Esn_Number = logicalattributecontext.getLogicalAttributeName("E SNNumber");
    String log_Vendor_Name = logicalattributecontext.getLogicalAttributeName("V endorName");
    String log_Device_Type = logicalattributecontext.getLogicalAttributeName("D eviceType");
    String log_Device_Model = logicalattributecontext.getLogicalAttributeName("D eviceModel");
    String log_Device_Description = logicalattributecontext.getLogicalAttributeName("D eviceDescription");
    String phys_device_name = logicalattributecontext.getPhysicalAttributeName(" Devices");
    String phys_tmp_name = logicalattributecontext.getPhysicalAttributeName(" TempAttr");
    String phys_device_val = logicalattributecontext.getLogicalAttributeValue(l og_Device_Type) + " | Asset Tag #: " + logicalattributecontext.getLogicalAttributeValue(l og_Asset_Tag) + " | Serial Number: " + logicalattributecontext.getLogicalAttributeValue(l og_Serial_Number) + " | Vendor Name: " + logicalattributecontext.getLogicalAttributeValue(l og_Vendor_Name) + " | Model: " + logicalattributecontext.getLogicalAttributeValue(l og_Device_Model);
    Devices = logicalattributecontext.getPhysicalAttributeMultiV alue(phys_device_name);
    if(logicalattributecontext.getLogicalAttributeValu e(log_Esn_Number).trim().length() > 0)
    {
    phys_device_val = phys_device_val + " | CELL ESN: " + logicalattributecontext.getLogicalAttributeValue(l og_Esn_Number);
    }
    String LAHModCount = (String)logicalattributecontext.getSessionAttribut e("lahModcount");
    if(LAHModCount == null || LAHModCount.indexOf("0") >= 0)
    {
    if(logicalattributecontext.getLogicalAttributeValu e(log_Asset_Tag).indexOf("CHANGE ME") >= 0)
    {
    logicalattributecontext.setPhysicalAttributeValue( phys_tmp_name, phys_device_val);
    } else
    {
    Devices.add(phys_device_val);
    logicalattributecontext.setPhysicalAttributeMultiV alue(phys_device_name, Devices);
    }
    logicalattributecontext.setSessionAttribute("lahMo dcount", "1");
    } else
    if(Integer.parseInt(LAHModCount) == 1)
    {
    System.out.println("LAH is being called muliple times. Therefore I am ignoring it!");
    } else
    {
    int parseer = Integer.parseInt(LAHModCount);
    parseer++;
    String test = parseer;
    logicalattributecontext.setSessionAttribute("lahMo dcount", test);
    }
    logDebugMessage("To phsysical: " + logicalattributecontext.getPhysicalAttributeValue( phys_device_name), false);
    }

    public void initialize(LogicalAttributeContext arg0)
    throws Exception
    {
    super.initialize(arg0);
    }
    }

  4. #4
    santunez is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Hello

    Now only appears the following error

    GenerateDevices.java:162: incompatible types
    found : int
    required: java.lang.String
    String test = parseer;
    ^
    1 error

  5. #5
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by santunez View Post
    Hello

    Now only appears the following error

    GenerateDevices.java:162: incompatible types
    found : int
    required: java.lang.String
    String test = parseer;
    ^
    1 error

    sure, you can't assign an integer to a string. use String test = String.valueOf(parseer).

    but with the other code i couldn't import the package com.netegrity, so all relative method calls to this package produced an error. where does this package come from?

  6. #6
    santunez is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Hello

    The packets come from an application called CA Identity Manager, I made the change indicated String test = String.valueOf (parseer), and compile without problems, creating the. Class, when the compilation is complete appears

    Note: GenerateDevices.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    When recompile with -Xlint appears:

    Building sample class
    GenerateDevices.java:75: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    cellPhoneModels.add(NonParsedFile.substring(NonPar sedFile.in
    dexOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:79: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    vendors.add(NonParsedFile.substring(NonParsedFile. indexOf(".
    ") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:83: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    computerModels.add(NonParsedFile.substring(NonPars edFile.ind
    exOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:95: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Computer");
    ^
    GenerateDevices.java:96: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Cell Phone");
    ^
    GenerateDevices.java:98: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("1");
    ^
    GenerateDevices.java:99: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("2 Phone");
    ^
    GenerateDevices.java:153: warning: [unchecked] unchecked call to add(E) as a mem
    ber of the raw type java.util.Vector
    Devices.add(phys_device_val);
    ^
    8 warnings

    are only warning, something goes wrong with the application?

    Best Regards

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,570
    Blog Entries
    7
    Rep Power
    21

    Default

    You are using a raw Vector instead of a parameterized Vector<T> so you lose all compile time type checks. It's not syntactically incorrect so the compiler only warns you but you're on your own here.

    kind regards,

    Jos

  8. #8
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Have you looked at the Sun Java Tutorial online? It should walk you through a ton of issues. Getting started with Java takes quite a bit of effort...

  9. #9
    emine.gulcin is offline Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Default Where are the packages?

    Hi,

    I am also dealing with CA IDM. I cannot find the packages which are in your code. I need them to compile my java classes in IDM.

    Thanks..
    Quote Originally Posted by santunez View Post
    Hello

    The packets come from an application called CA Identity Manager, I made the change indicated String test = String.valueOf (parseer), and compile without problems, creating the. Class, when the compilation is complete appears

    Note: GenerateDevices.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    When recompile with -Xlint appears:

    Building sample class
    GenerateDevices.java:75: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    cellPhoneModels.add(NonParsedFile.substring(NonPar sedFile.in
    dexOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:79: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    vendors.add(NonParsedFile.substring(NonParsedFile. indexOf(".
    ") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:83: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    computerModels.add(NonParsedFile.substring(NonPars edFile.ind
    exOf(".") + 1, NonParsedFile.length()));
    ^
    GenerateDevices.java:95: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Computer");
    ^
    GenerateDevices.java:96: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    deviceType.add("Cell Phone");
    ^
    GenerateDevices.java:98: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("1");
    ^
    GenerateDevices.java:99: warning: [unchecked] unchecked call to add(E) as a memb
    er of the raw type java.util.Vector
    test.add("2 Phone");
    ^
    GenerateDevices.java:153: warning: [unchecked] unchecked call to add(E) as a mem
    ber of the raw type java.util.Vector
    Devices.add(phys_device_val);
    ^
    8 warnings

    are only warning, something goes wrong with the application?

    Best Regards

Similar Threads

  1. Difficult compilation
    By pochis40 in forum Java Applets
    Replies: 10
    Last Post: 12-21-2009, 12:35 PM
  2. another compilation prob!!!
    By aiacos88 in forum JCreator
    Replies: 4
    Last Post: 01-27-2009, 03:16 AM
  3. Compilation Problem
    By whosadork in forum New To Java
    Replies: 6
    Last Post: 09-10-2008, 02:50 AM
  4. Jasper compilation
    By java_hunter in forum XML
    Replies: 0
    Last Post: 07-16-2008, 03:01 PM
  5. compilation issue
    By orchid in forum Eclipse
    Replies: 2
    Last Post: 04-20-2007, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •