Visual Studio 2012 cannot resolve symbol or Errors control is not a member of class

Visual Studio 2012 Web Site Project (Note not a Web application, so there are not Designer.vb files) > Site works perfectly fine and using IIS and attaching to IIS to debug code.
However, if I try to build the site inside of Visual Studio I am getting lots of Errors ‘pnlName’ is not a member of ‘Page_Name’ In the code behind I am getting errors ‘Cannot resolve symbol ‘pnlName’
.ascx Page
<li style="margin-right:0;" id="pnlName" runat="server"><a href="/cart" title="Checkout" class="global-checkout">Checkout</a></li>
.ascx.vb page
Me.pnlName.Attributes.Remove("style")
I have cleaned, rebuild and nothing gets rid of these errors, but again the site works as designed, but I would like to launch and debug inside of Visual Studio.
Moojjoo MCP, MCTS
MCP Virtual Business Card
http://moojjoo.blogspot.com

Cor,
What I am stating is this is a solution using the Web Site Project instead of a
Web Application Project.
Web Site projects do not require Designer.vb files, Web Application Projects add Designer.vb files in the solution.   
Background: I have been hired to support a very successful e-commerce site that was built by a 3rd party vendor (I had no input on the contract or specification, because I would have went with
MVC).  The site works 100% correctly, however from my 2003 - 2015 experience with Visual Studio and Web Development being in Web Forms and MVC I have always built ASP.NET Solutions using the Web Application Project Templates, which compiles the code down
to .dlls.  
A Web Site project does not compile the code, but simply uses the .vb files and they have to be migrated to the server with the .aspx files. http://msdn.microsoft.com/en-us/library/dd547590%28v=vs.110%29.aspx
Currently the only way I can debug this Solution is to attach to the w3wp.exe process running locally on my work station. 
The Solution is comprised of two Web Sites, which I cannot get it to compile because of the following errors -
 'webServerControlName' is not a member of '(Protected Code Behind Class Name)'  I am reaching out to the MSDN community to see if anyone has experienced this issue with
Web Site Projects.
I hope that clears up the Project Type question.
Moojjoo MCP, MCTS
MCP Virtual Business Card
http://moojjoo.blogspot.com

Similar Messages

  • Error compiling EJB.jar  + cannot resolve symbol+while deploying

    I am getting following
    Error compiling EJB.jar , cannot resolve symbol ,Syntax error in source, am getting around 17 errors while deploying EAR generated using Jdev905 into standalone oc4jContainers(10g).
    Can anyone please help me out where is the problem.
    Regards,
    Anup

    cannot resolve symbol ,Syntax error in source
    indicates some jar file is not in the Classpath. Is j2ee.jar in the Classpath?

  • Error on Form Designer on Visual Studio 2012

    Dear Sir,
    I have used Visual Studio 2012 to develop my project for a long time.
    However, suddenly Designer of all Forms come an error but the system can compile the project.
    Therefore, I am not able to change the design of the Form in Visual Studio.
    Any Suggestion?
    Thank you very much.
    The following is the Error of the Designer:
    To prevent possible data loss before loading the designer, the following errors must be resolved:
    1 Error
    The type 'System.Configuration.UserScopedSettingAttribute' could not be found. Ensure that the assembly containing the type is referenced. If the assembly is part of the current development project, ensure that the project has been built.
    Instances of this error (1)
    1. Hide Call Stack
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetType(String name, Boolean throwOnError)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.FillAttributes(Resolver resolver, CodeTypeMember member, Attribute[]& customAttributes, MemberAttributes& memberAttributes)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.InitializeFromType(ITypeResolutionService typeResolutionService, CodeTypeDeclaration typeDecl, String namespaceName)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.InitializeFromType(ITypeResolutionService typeResolutionService, CodeNamespace ns)
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.BuildType()
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.GetObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode()
    at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.TrackGlobal(GlobalObjectProvider p, GlobalType g)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetType(String typeName)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
    Best regards,
    Felix

    Hello Felix,
    The info seems tell us your project is corrupt. May I ask this question, will this error reproduce when you create a new simple project? This can be divided into two scenarios:
    Scenario 1: The new project is also corrupt.
    In that way, your Visual Studio may already corrupt. It's time for you to repair your Visual Studio from control panel.
    If it still not work, try use some common steps below to fix:
    Please open an administrative CMD window and navigate to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE and run these commands:
    1.devenv.exe  /safemode
    2.devenv.exe  /resetskippkgs
    3.devenv.exe  /installvstemplates
    4.devenv.exe  /resetsettings
    5.devenv.exe  /resetuserdata 
    Scenario 2: The new project doesnot get this issue.
    In this way, we should focus on this "The type
    'System.Configuration.UserScopedSettingAttribute' could
    not be found"
    See here from MSDN to know how we can use it in our code:
    https://msdn.microsoft.com/en-us/library/system.configuration.userscopedsettingattribute(v=vs.110).aspx
    Check whether your code list something like below code and check whether you have missed anything here.
    //Application settings wrapper class
    sealed class FormSettings : ApplicationSettingsBase
    [UserScopedSettingAttribute()]
    public String FormText
    get { return (String)this["FormText"]; }
    set { this["FormText"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("0, 0")]
    public Point FormLocation
    get { return (Point)(this["FormLocation"]); }
    set { this["FormLocation"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("225, 200")]
    public Size FormSize
    get { return (Size)this["FormSize"]; }
    set { this["FormSize"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("LightGray")]
    public Color FormBackColor
    get { return (Color)this["FormBackColor"]; }
    set { this["FormBackColor"] = value; }
    Or you can copy your project content to a new fresh project and rebuild your project with new settings.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Visual Studio 2012 SharePoint Project Error : The partial project item type does not have a value for this property

    Hi,
    I am getting this error from visual studio 2012 whenever i try to create the following project types:
    - Workflow Custom activity
    - Web parts
    The error is as mentioned below
    "The partial project item type does not have a value for this property"
    Due to this the when I add above type of items in my project, they show a red cross icon against them.
    Please let me know If have you any solution?

    Hi
    I had same issue. Below is the solution
    Installing
    "Visual Studio 2012 Update 3" usually solves this problem. (You can download it through microsoft's official site at
    "http://www.microsoft.com/en-in/download/details.aspx?id=39305")
    Hansraj Rathva

  • Getting error message Cannot Resolve Symbol when trying to compile a class

    Hello All -
    I am getting an error message cannot resolve symbol while trying to compile a java class that calls another java class in the same package. The called class compiles fine, but the calling class generates
    the following error message:
    D:\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes\cal>javac
    ConnectionPool.java
    ConnectionPool.java:158: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    private void addConnection(PooledConnection value) {
    ^
    ConnectionPool.java:144: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    PooledConnection pcon = new PooledConnection(con);
    ^
    ConnectionPool.java:144: cannot resolve symbol
    symbol : class PooledConnection
    location: class cal.ConnectionPool
    PooledConnection pcon = new PooledConnection(con);
    The code is listed as follows for PooledConnection.java (it compiles fine)
    package cal;
    import java.sql.*;
    public class PooledConnection {
    // Real JDBC Connection
    private Connection connection = null;
    // boolean flag used to determine if connection is in use
    private boolean inuse = false;
    // Constructor that takes the passed in JDBC Connection
    // and stores it in the connection attribute.
    public PooledConnection(Connection value) {
    if ( value != null ) {
    connection = value;
    // Returns a reference to the JDBC Connection
    public Connection getConnection() {
    // get the JDBC Connection
    return connection;
    // Set the status of the PooledConnection.
    public void setInUse(boolean value) {
    inuse = value;
    // Returns the current status of the PooledConnection.
    public boolean inUse() {
    return inuse;
    // Close the real JDBC Connection
    public void close() {
    try {
    connection.close();
    catch (SQLException sqle) {
    System.err.println(sqle.getMessage());
    Now the code for ConnectionPool.java class that gives the cannot
    resolve symbol error
    package cal;
    import java.sql.*;
    import java.util.*;
    public class ConnectionPool {
    // JDBC Driver Name
    private String driver = null;
    // URL of database
    private String url = null;
    // Initial number of connections.
    private int size = 0;
    // Username
    private String username = new String("");
    // Password
    private String password = new String("");
    // Vector of JDBC Connections
    private Vector pool = null;
    public ConnectionPool() {
    // Set the value of the JDBC Driver
    public void setDriver(String value) {
    if ( value != null ) {
    driver = value;
    // Get the value of the JDBC Driver
    public String getDriver() {
    return driver;
    // Set the URL Pointing to the Datasource
    public void setURL(String value ) {
    if ( value != null ) {
    url = value;
    // Get the URL Pointing to the Datasource
    public String getURL() {
    return url;
    // Set the initial number of connections
    public void setSize(int value) {
    if ( value > 1 ) {
    size = value;
    // Get the initial number of connections
    public int getSize() {
    return size;
    // Set the username
    public void setUsername(String value) {
    if ( value != null ) {
    username = value;
    // Get the username
    public String getUserName() {
    return username;
    // Set the password
    public void setPassword(String value) {
    if ( value != null ) {
    password = value;
    // Get the password
    public String getPassword() {
    return password;
    // Creates and returns a connection
    private Connection createConnection() throws Exception {
    Connection con = null;
    // Create a Connection
    con = DriverManager.getConnection(url,
    username, password);
    return con;
    // Initialize the pool
    public synchronized void initializePool() throws Exception {
    // Check our initial values
    if ( driver == null ) {
    throw new Exception("No Driver Name Specified!");
    if ( url == null ) {
    throw new Exception("No URL Specified!");
    if ( size < 1 ) {
    throw new Exception("Pool size is less than 1!");
    // Create the Connections
    try {
    // Load the Driver class file
    Class.forName(driver);
    // Create Connections based on the size member
    for ( int x = 0; x < size; x++ ) {
    Connection con = createConnection();
    if ( con != null ) {
    // Create a PooledConnection to encapsulate the
    // real JDBC Connection
    PooledConnection pcon = new PooledConnection(con);
    // Add the Connection to the pool.
    addConnection(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // Adds the PooledConnection to the pool
    private void addConnection(PooledConnection value) {
    // If the pool is null, create a new vector
    // with the initial size of "size"
    if ( pool == null ) {
    pool = new Vector(size);
    // Add the PooledConnection Object to the vector
    pool.addElement(value);
    public synchronized void releaseConnection(Connection con) {
    // find the PooledConnection Object
    for ( int x = 0; x < pool.size(); x++ ) {
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // Check for correct Connection
    if ( pcon.getConnection() == con ) {
    System.err.println("Releasing Connection " + x);
    // Set its inuse attribute to false, which
    // releases it for use
    pcon.setInUse(false);
    break;
    // Find an available connection
    public synchronized Connection getConnection()
    throws Exception {
    PooledConnection pcon = null;
    // find a connection not in use
    for ( int x = 0; x < pool.size(); x++ ) {
    pcon = (PooledConnection)pool.elementAt(x);
    // Check to see if the Connection is in use
    if ( pcon.inUse() == false ) {
    // Mark it as in use
    pcon.setInUse(true);
    // return the JDBC Connection stored in the
    // PooledConnection object
    return pcon.getConnection();
    // Could not find a free connection,
    // create and add a new one
    try {
    // Create a new JDBC Connection
    Connection con = createConnection();
    // Create a new PooledConnection, passing it the JDBC
    // Connection
    pcon = new PooledConnection(con);
    // Mark the connection as in use
    pcon.setInUse(true);
    // Add the new PooledConnection object to the pool
    pool.addElement(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // return the new Connection
    return pcon.getConnection();
    // When shutting down the pool, you need to first empty it.
    public synchronized void emptyPool() {
    // Iterate over the entire pool closing the
    // JDBC Connections.
    for ( int x = 0; x < pool.size(); x++ ) {
    System.err.println("Closing JDBC Connection " + x);
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // If the PooledConnection is not in use, close it
    if ( pcon.inUse() == false ) {
    pcon.close();
    else {
    // If it is still in use, sleep for 30 seconds and
    // force close.
    try {
    java.lang.Thread.sleep(30000);
    pcon.close();
    catch (InterruptedException ie) {
    System.err.println(ie.getMessage());
    I am using Sun JDK Version 1.3.0_02" and Apache/Tomcat 4.0. Both the calling and the called class are in the same directory.
    Any help would be greatly appreciated.
    tnx..
    addi

    Is ConnectionPool in this "cal" package as well as PooledConnection? From the directory you are compiling from it appears that it is. If it is, then you are compiling it incorrectly. To compile ConnectionPool (and PooledConnection similarly), you must change the current directory to the one that contains cal and type
    javac cal/ConnectionPool.

  • Class error - cannot resolve symbol "MyDocumentListener"

    Hello,
    this is a groaner I'm sure, but I don't see the problem.
    Newbie-itis probably ...
    I'm not concerned with what the class does, but it would be nice for the silly thing to compile!
    What the heck am I missing for "MyDocumentListener" ?
    C:\divelog>javac -classpath C:\ CenterPanel.java
    CenterPanel.java:53: cannot resolve symbol
    symbol : class MyDocumentListener
    location: class divelog.CenterPanel
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    ^
    CenterPanel.java:53: cannot resolve symbol
    symbol : class MyDocumentListener
    location: class divelog.CenterPanel
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    ^
    2 errors
    package divelog;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.lang.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.text.*;
    public class CenterPanel extends JPanel implements ActionListener
    { // Opens class
    static private final String newline = "\n";
    private JTextArea comments;
    private JScrollPane scrollpane;
    private JButton saveButton, openButton;
    private JLabel whiteshark;
    private Box box;
    private BufferedReader br ;
    private String str;
    private JTextArea instruct;
    private File defaultDirectory = new File("C://divelog");
    private File fileDirectory = null;
    private File currentFile= null;
    public CenterPanel()
    { // open constructor CenterPanel
    setBackground(Color.white);
    comments = new JTextArea("Enter comments, such as " +
    "location, water conditions, sea life you observed," +
    " and problems you may have encountered.", 15, 10);
    comments.setLineWrap(true);
    comments.setWrapStyleWord(true);
    comments.setEditable(true);
    comments.setFont(new Font("Times-Roman", Font.PLAIN, 14));
    // add a document listener for changes to the text,
    // query before opening a new file to decide if we need to save changes.
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    comments.getDocument().addDocumentListener(myDocumentListener); // create the reference for the class
    // ------ Document listener class -----------
    class MyDocumentListener implements DocumentListener {
    public void insertUpdate(DocumentEvent e) {
    Calculate(e);
    public void removeUpdate(DocumentEvent e) {
    Calculate(e);
    public void changedUpdate(DocumentEvent e) {
    private void Calculate(DocumentEvent e) {
    // do something here
    scrollpane = new JScrollPane(comments);
    scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    saveButton = new JButton("Save Comments", new ImageIcon("images/Save16.gif"));
    saveButton.addActionListener( this );
    saveButton.setToolTipText("Click this button to save the current file.");
    openButton = new JButton("Open File...", new ImageIcon("images/Open16.gif"));
    openButton.addActionListener( this );
    openButton.setToolTipText("Click this button to open a file.");
    whiteshark = new JLabel("", new ImageIcon("images/gwhite.gif"), JLabel.CENTER);
    Box boxH;
    boxH = Box.createHorizontalBox();
    boxH.add(openButton);
    boxH.add(Box.createHorizontalStrut(15));
    boxH.add(saveButton);
    box = Box.createVerticalBox();
    box.add(scrollpane);
    box.add(Box.createVerticalStrut(10));
    box.add(boxH);
    box.add(Box.createVerticalStrut(15));
    box.add(whiteshark);
    add(box);
    } // closes constructor CenterPanel
    public void actionPerformed( ActionEvent evt )
    { // open method actionPerformed
    JFileChooser jfc = new JFileChooser();
    // these do not work !!
    // -- set the file types to view --
    // ExtensionFileFilter filter = new ExtensionFileFilter();
    // FileFilter filter = new FileFilter();
    //filter.addExtension("java");
    //filter.addExtension("txt");
    //filter.setDescription("Text & Java Files");
    //jfc.setFileFilter(filter);
         //Add a custom file filter and disable the default "Accept All" file filter.
    jfc.addChoosableFileFilter(new JTFilter());
    jfc.setAcceptAllFileFilterUsed(false);
    // -- open the default directory --
    // public void setCurrentDirectory(File dir)
    // jfc.setCurrentDirectory(new File("C://divelog"));
    jfc.setCurrentDirectory(defaultDirectory);
    jfc.setSize(400, 300);
    jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    Container parent = saveButton.getParent();
    //========================= Test Button Actions ================================
    //========================= Open Button ================================
    if (evt.getSource() == openButton)
    int choice = jfc.showOpenDialog(CenterPanel.this);
    File file = jfc.getSelectedFile();
    /* a: */
    if (file != null && choice == JFileChooser.APPROVE_OPTION)
    String filename = jfc.getSelectedFile().getAbsolutePath();
    // -- compare the currentFile to the file chosen, alert of loosing any changes to currentFile --
    // If (currentFile != filename)
    // -- get the current directory name -------
    // public File getCurrentDirectory( );
    File f=new File(System.getProperty("user.dir"));
    fileDirectory = jfc.getCurrentDirectory();
    // -- remember the last directory used --
    if (defaultDirectory != fileDirectory)
    {defaultDirectory = fileDirectory;}
    try
    { //opens try         
    comments.getLineCount( );
    // -- clear the old data before importing the new file --
    comments.selectAll();
    comments.replaceSelection("");
    // -- get the new data ---
    br = new BufferedReader (new FileReader(file));
    while ((str = br.readLine()) != null)
    {//opens while
    comments.append(str);
    } //closes while
    } // close try
    catch (IOException ioe)
    { // open catch
    comments.append(newline +"Open command not successful:" + ioe + newline);
    } // close catch
    // ---- display the values of the directory variables -----------------------
    comments.append(
    newline + "The f directory variable contains: " + f +
    newline + "The fileDirectory variable contains: " + fileDirectory +
    newline + "The defaultDirectory variable contains: " + defaultDirectory );
    else
    comments.append("Open command cancelled by user." + newline);
    } //close if statement /* a: */
    //========================= Save Button ================================
    } else if (evt.getSource() == saveButton)
    int choice = jfc.showSaveDialog(CenterPanel.this);
    if (choice == JFileChooser.APPROVE_OPTION)
    File fileName = jfc.getSelectedFile();
    // -- get the current directory name -------
    // public File getCurrentDirectory( );
    File f=new File(System.getProperty("user.dir"));
    fileDirectory = jfc.getCurrentDirectory();
    // -- remember the last directory used --
    if (defaultDirectory != fileDirectory)
    {defaultDirectory = fileDirectory;}
    //check for existing files. Warn users & ask if they want to overwrite
    for(int i = 0; i < fileName.length(); i ++) {
    File tmp = null;
    tmp = (fileName);
    if (tmp.exists()) // display pop-up alert
    //public static int showConfirmDialog( Component parentComponent,
    // Object message,
    // String title,
    // int optionType,
    // int messageType,
    // Icon icon);
    int confirm = JOptionPane.showConfirmDialog(null,
    fileName + " already exists on " + fileDirectory
    + "\n \nContinue?", // msg
    "Warning! Overwrite File!", // title
    JOptionPane.OK_CANCEL_OPTION, // buttons displayed
                        // JOptionPane.ERROR_MESSAGE
                        // JOptionPane.INFORMATION_MESSAGE
                        // JOptionPane.PLAIN_MESSAGE
                        // JOptionPane.QUESTION_MESSAGE
    JOptionPane.WARNING_MESSAGE,
    null);
    if (confirm != JOptionPane.YES_OPTION)
    { //user cancels the file overwrite.
    try {
    jfc.cancelSelection();
    break;
    catch(Exception e) {}
    // ----- Save the file if everything is OK ----------------------------
    try
    { // opens try
    BufferedWriter bw = new BufferedWriter(new FileWriter(fileName));
    bw.write(comments.getText());
    bw.flush();
    bw.close();
    comments.append( newline + newline + "Saving: " + fileName.getName() + "." + newline);
    break;
    } // closes try
    catch (IOException ioe)
    { // open catch
    comments.append(newline +"Save command unsuccessful:" + ioe + newline);
    } // close catch
    } // if exists
    } //close for loop
    else
    comments.append("Save command cancelled by user." + newline);
    } // end-if save button
    } // close method actionPerformed
    } //close constructor CenterPanel
    } // Closes class CenterPanel

    There is no way to be able to see MyDocumentListener class in the way you wrote. The reason is because MyDocumentListener class inside the constructor itself. MyDocumentListener class is an inner class, not suppose to be inside a constructor or a method. What you need to do is simple thing, just move it from inside the constructor and place it between two methods.
    that's all folks
    Qusay

  • Cannot resolve symbol error even with class imported

    Hi
    I'm trying to print out a java.version system property but keep getting a
    cannot resolve symbol error
    symbol: class getProperty
    location: class java.lang.System
    I've looked at the API and getProperty() is a method of lang.System
    Can anyone throw any light?
    thanks
    import java.lang.System;
    class PropertiesTest {
        public static void main(String[] args) {
                String v = new System.getProperty("java.version");
                 System.out.println(v);
    }

    Thanks Jos
    It compiles but I now get a runtime error
    Exception in thread "main"
    java.lang.NoClassDefFoundError:PropertiesTest
    What do you reckon is the problem?
    thanks
    java -cp .;<any other directories or jars>
    YourClassNameYou get a NoClassDefFoundError message because the
    JVM (Java Virtual Machine) can't find your class. The
    way to remedy this is to ensure that your class is
    included in the classpath. The example assumes that
    you are in the same directory as the class you're
    trying to run.I know it's a bad habit but I've put this file (PropertiesTest.java) and the compiled class (PropertiesTest.class) both in my bin folder which contains the javac compiler

  • Cannot resolve symbol : class odbc ERROR

    Hi Helper
    I am trying to compile a the following and I am getting the error
    C:\jdk\websiter>javac MainServlet.java
    MainServlet.java:86: cannot resolve symbol
    symbol : class odbc
    location: package jdbc
    Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    * This is the servlet to send the user the names of all the sites present in the database
    public class MainServlet extends HttpServlet implements ServletConstants
    Connection m_con;
    PreparedStatement m_pstmt;
    ResultSet m_res;
    Vector m_vecsiteName;
    public void Init(ServletConfig config) throws ServletException {
         super.init(config);
    }// end of init()
    public void service(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
              m_vecsiteName = new Vector();
         try {
         Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
    m_con = DriverManager.getConnection("jdbc:odbc:sitewd", "", "");
    How can i fix it? thanks
    VT

    Replace the Statement
    Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
    as
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

  • Cannot resolve symbol class Scanner (Error)

    For whatever reason I get the error message "cannot resolve symbol class Scanner" when trying to run this:
    import java.io.*;
    import java.util.*;
    public class NameReversal
         public static void main(String args[])
              System.out.print("Enter your name: ");
              Scanner Reader = new Scanner(System.in);
              String first = Reader.next();
              String finl = Reader.next();
              int z = first.length();
              int v = finl.length();
              int y = z-1;
              int f = y-1;
              for(int i = y; i>=0; z--)
              System.out.print(first.charAt(1));
              System.out.print(" ");
              for(int p = f; p >= 0; p--)
              System.out.println(finl.charAt(p));
    }

    The Scanner class is in the JDK version 1.5 or later. You must be using an earlier version.

  • Error:cannot resolve Symbol class"name"

    when I have compiled Bean class named SlBean which has primary class named pk, I recevied following error message(I compiled pk class without error) :
    cannot resolve symbol
    symbol : class pk
    location: class SlBean
    public pk ejbCreate(

    Sorry , its not classpath problem. You have to simply import the pk class if its in any package. I am assuming you have packaged your pk class with ejb jar file.
    for eg. if your class is
    package abc.xyz
    public class pk
    then in your bean class import
    import abc.xyz.pk;
    --Ashwani                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Compiling error - cannot resolve symbol

    Hi,
    I am working on writing out this basic code for a project. When I compile, I get an error "Cannot resolve symbol" for the gpa variable. Please help!
    My intention is to use the hours and points from the crHours and nbrPoints methods, and use them to calculate GPA in the grPtAvg method:
    public class Student
         public static void main(String[]args)
    idNum();
    crHours();
    nbrpoints();
    gpa = grPtAvg(hours, points);
    System.out.println("Student's GPA is " + gpa);
    public static void idNum()
    int id = 2520;
    System.out.println("Student's ID is " + id);
    public static float crHours()
    float hours = 5;
    System.out.println("Student's credit hours are " + hours);
    return hours;
    public static float nbrpoints()
    float points = 22;
    System.out.println("Student's earned points are " + points);
    return points;
    public static float grPtAvg(float hours, float points)
    float gpa;
    gpa = points / hours;
    System.out.println("Student's computed GPA is " + gpa);
    return gpa;

    That's because you're doing the same thing (in a somewhat different way) with those.
    The variables: hours and points have already been returned to main methd, right?Yes, but then the main method ignores them.
    So, they should be available at this point in the code, is that right?Available in the sense that you can read them, but not in the sense that there are hours and points variables within scope in the main method.
    You want to do this:
    public static void main(String[] args) {
       idNum();
       float hours = crHours();
       float points = nbrpoints();
       //create a new float
       float myComputetdGpa = grPtAvg(hours, points);
       System.out.println("Student's GPA is " + myComputedGpa);
    }

  • App.Xaml cannot be edited in design view(Visual Studio 2012 for Window Store).

     App.Xaml cannot be edited in design view(Visual Studio 2012 for Window Store).

    The
    Simple Application Walkthrough specifically instructs one to edit App.xaml (because it previously had you inject a defect by changing the name of the file StartupUri property points to). So that is the scenario, or one of them. I assume it is 'valid'
    to rename MainWindow.xaml to whatever you want it to be.
    So there should be some way in the IDE to fix this (short of changing the file name back to match StartupUri). What is it? 
    Like another person here, I just edited it with a text editor and reloaded it into VS. But...

  • Cannot preview SSRS report in Visual Studio 2012 - assembly does not allow partially trusted callers

    Hi,
    I have an SSRS report that works fine in Visual Studio 2008 BIDS.  This report references a .Net assembly namely:
    System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    I use this assembly in some simple Code functions in the report. e.g.
    System.Web.HttpUtility.UrlEncode(inURL).ToString
    I have converted the SSRS project to 2012 and am trying to preview the report.  However, I get an error relating to: "That assembly does not allow partially trusted callers".  If i deploy the rdl to my local SSRS it renders fine, but
    how do I fix Visual Studio to preview the report without error? This is highly annoying.
    My Visual Studio version is:
    Microsoft Visual Studio Professional 2012
    Version 11.0.61030.00 Update 4
    Microsoft .NET Framework
    Version 4.5.51641
    SQL Server Reporting Services  
    Microsoft SQL Server Reporting Services Designers
    Version 11.0.3402.0
    Any help is appreciated on this one.
    Regards,
    MrHH

    Hi MrHappyHead,
    According to your description, you used custom assembly in the report, when you run the report in Visual Studio 2008, the report works fine. When you run the report in Visual Studio 2012, the error message occurred: "That assembly does not allow partially
    trusted callers".  But the report works fine after you deployed it to report manager.
    Only applications that are fully trusted by the runtime code access security system are allowed to access a shared managed code assembly that is not explicitly marked with the System.Security.AllowPartiallyTrustedCallers attribute. A partially trusted assembly
    (one that is registered in SQL Server with the SAFE or EXTERNAL_ACCESS permission set) that attempts to access a strong-name signed assembly without this attribute causes a System.Security.SecurityException to be thrown. To troubleshoot the problem, please
    refer to the following steps:
    Add namespace system.security to AssemblyInfo.cs file
    Add [assembly:allowpartiallytrustedcaller] to the file.
    Set trust level to "Full" in web.config file
    For more information, please refer to the following document:
    http://support.microsoft.com/kb/2869522/en-us
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Weird cannot resolve symbol error.

    I'm having a problem with the most simple thing, but I really don't know what is th error, maybe I can�t see the error because the lack of rest.
    I have two classes, both are in a package and in the same folder.
    This is are the problematic lines.
    tmpLong = calculateSizeFile("sonido.wav");
    tmpInt = calculateSizeSegment("sonido.wav");
    SendFile file1 = new SendFile(args[0], "sonido.wav", 2, 32, 2, 2, tmpLong, tmpInt);
    The SendFile is the other class and it�s a thread.
    The package decalaration is:
    package com.sigmatao.gde.batch;
    This is the constructor of the other class:
    public SendFile(String httpServlet, String file, int numberRetry, int maxTimeWait,int multiplier,int timeMin, long sizeFileToSend, int sizeSegmentFile)
    Thanks in advanced for the help.

    C:\Temp\URL\com\sigmatao\gde\batch>javac BatchTransfer.java
    BatchTransfer.java:20: cannot resolve symbol
    symbol : class SendFile
    location: class com.sigmatao.gde.batch.BatchTransfer
    SendFile file1 = new SendFile(args[0], "sonido.wav", 2, 32, 2, 2, tmpLon
    g, tmpInt);
    ^
    BatchTransfer.java:20: cannot resolve symbol
    symbol : class SendFile
    location: class com.sigmatao.gde.batch.BatchTransfer
    SendFile file1 = new SendFile(args[0], "sonido.wav", 2, 32, 2, 2, tmpLon
    g, tmpInt);
    This is the problem.

  • HELP PLEASE Cannot resolve symbol error

    Only just started to atempt simple java programs and this same error keeps appearing. code i am using is:
    import java.io.*;
    class Q1
         public static void main(String[] args) throws IOException
              int num1,num2,sum;
              /*program statements start here*/
         System.out.printIn ("Input a number");
                   num1= Course_io.readInt();
              System.out.printIn ("Input another number");
                   num2= Course_io.readInt();
                   sum= num2 - num1;
              System.out.printIn ("Total is" +sum );
    and this is the error message i keep getting:
    javac -d . -g "C:\Java Programs\Q1.java"
    C:\Java Programs\Q1.java:12: cannot resolve symbol
    symbol : method printIn (java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn ("Input a number");
    ^
    C:\Java Programs\Q1.java:16: cannot resolve symbol
    symbol : method printIn (java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn ("Input another number");
    ^
    C:\Java Programs\Q1.java:22: cannot resolve symbol
    symbol : method printIn (java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn ("Total is" +sum );
    ^
    3 errors
    Please help me, Thankyou.

    sum= num2 - num1;
    System.out.printIn ("Total is" +sum );While you're at it, do something about this, it's misleading.
    kind regards,
    Jos

Maybe you are looking for