Cannot resolve type
Hi,
I would like to import some .class files into my program.
I have them in a folder under name pack1 in my source directory. pack1 contains a file called I2CPort.class, but no I2CPort.java file (though I'm not sure if you need any for import statements)
When I write import pack1.*; everything is fine. But when I would like to instantiate the class in the main method with for example I2CPort readPort = new I2CPort (para1,para2,para3); I get an error: I2CPort cannot be resolved to a type.
I'm 100% sure that the I2CPort has a constructor with 3 parameters, so there must be something else...
Any suggestions?
bizso wrote:
Well, after nearly 6 hours of suffering I have managed to solve it. The problem was that when you import class packages, you must provide them in a compressed zip or jar format, otherwise the compiler automatically puts them into a "default package", which however cannot be imported. That is to say the package can be imported, only the classes not... sigh*You have a misunderstanding. It is true that you can not import classes that are in the default package. However, it is very possible to import classes that are not in jar/zip format as long as they are in a named package. Since you are using Eclipse, I can not tell you how but I am sure Eclipse supports it.
Also, you might have the wrong understanding of what import does. This may help [http://java.sun.com/docs/books/tutorial/java/package/index.html]
Similar Messages
-
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.comCor,
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 -
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..
addiIs 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 CenterPanelThere 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 -
Hello, say i have a class
A
that contains an object of class B.
Now there's class X...
It's all fine and dandy trying to compile them both until i try to set the classpath for junit, by doing:
set classpath=%classpath%;C:\junit3.8.1\junit.jar
i'm pretty sure it's correct...
well once i type in this line into my command prompt (win 2k), the junit package now seems to be recognized by class X, which is my testing class that contains an object of class A.
but NOW class A can't find class B and i get a cannot resolve symbol error. Same goes for class X not being able to find class A.
Anyone have any suggestions? I'm a newb to this :( . Thanks.nevermind! noob mistake.
-
There is a link with someone else who was receiving the same error, but i believe for different reasons.
http://social.technet.microsoft.com/Forums/en-US/outlook/thread/43221dbf-60e1-4afb-8c25-f23f06deed3e
I just performed an upgrade from office 2007 enterprise to office professional plus 2010 today (I am running Windows 7) and I keep getting this error:
Microsoft Outlook
The operation failed. The messaging interfaces have returned an unknown error. If the problem persists, restart Outlook. Cannot resolve recipient.
P1: 300531
P2: 14.0.4763.1000
P3: 6xk3
P4: 0x80040700
It happens when I reply to an email. The addresses are in the format which outlook 2003 and 2007 have been using
Webb, Sydney A <[email protected]>
I notice that if I simply type the address:
[email protected]
it will send fine.
I also notice, the format for contacts has changed to Webb, Sydney A ([email protected])
() instead of <>
i assume that is what is causing the issue, but all of my incoming emails are marked with the old style, so when I hit reply I have to retype the addresses every time(even for the same contact on following email replies). I am sending via POP3(gmail
account in PST is default), but I do have an exchange account configured which I occasionally connect to.
any ideas on how to change the incoming format of messages so the sender's address is in the new format?
I would greatly appreciate any help.
Christopher Webb http://christophermichaelwebb.comI too updated from 2007 to 2010 and couldn't send group emails. After reading many of the suggestions here, I discovered a simple solution. I simply clicked on the outlook contact, opened up the file in the address book, and changed the display name.
I had some addresses that were listed under "display" like this: John Doe ([email protected]). I changed each of those in the display field to read either John Doe or Doe, John. I saved the contact and continued.
Note: I discovered this problem in sending out group emails. So I opened the groups one by one. Then I scanned down the list of displayed names, and clicked on any with the combination of name and address to them as an outlook address card.
In the card, I changed the display name, and then clicked "update" to update the list with the new listing. Sometimes after updating, the display name had not changed. Hmmm... I noticed that there were two kinds of card icons to
the far left of the displayed name. With the lighter-appearing icon, changing did not work. I had to delete the individual person in the group, and then re-add them by clicking "add member." Now they had disappeared in the listing. So
I clicked "advanced find." There I put in their names or a portion of the email address, and found them quickly. Then I double clicked on the correct listing to add the person back into the group.
At that point, the icon to the left of the displayed names had changed to a darker icon like the majority of my members, and clicking on the name to open the file worked, as did changing the display name. Then when I clicked "update", I had
the correct display name. The changes stuck. I think perhaps the lighter-appearing icon were adds to the group that I had not added to my outlook address book, but only to the group email. It was so long ago that I added these members originally
that I have no idea any more.
So now we know two things: Display the name only, or display the email address only. Both work. Just don't display the combination with parentheses. I wondered if perhaps the Outlook 2010 couldn't find that kind of listing referenced
in the outlook address book, and that's what is causing this hangup?
I hope this helps someone save a lot of time and irritation. It was a fairly easy fix. -
Decision service cannot resolve RL function through Rules Connection
Decision service cannot resolve RL function through Rules Connection. I have created a function with argument Strinag and return type String.
ANybody here ?
-
Service cannot resolve identity in realm
Hello
I have configured oid as security provider of hw_services in SOA Suite 10.1.3 (with oid 10.1.4) , I have done folowing steps :
1- I have changed is-config.xml file such as the following
<configuration realmName="myrealm" default="true">
<provider providerType="LDAP" name="OID" service="Identity">
<connection url="ldap://myoidserver:389" binddn="cn=orcladmin" password="!mypassword" encrypted="true">
<pool initsize="2" maxsize="25" prefsize="10" timeout="60"/>
</connection>
</provider>
</configuration>
2-I have changed Security provider of hw_services to my oid server.
my problem is that when I want to test identity web service methods everybody raises error depending identity service configuration for example when I test authenticateUser method it raise error : "Internal Server Error (Caught exception while handling request: BPEL-10519 Identity service system error. Error while invoking Identity service. Service cannot resolve identity in realm "{0}" Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable. )"
Please Help fixing this problemIn the link I provided
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28982/service_config.htm#BABFIJFB
is also a sample config file for OID
<?xml version = '1.0' encoding = 'UTF-8'?>
<ISConfiguration
xmlns="http://www.oracle.com/pcbpel/identityservice/isconfig">
<configurations>
<configuration realmName="us" displayName="us Realm">
<provider providerType="JAZN" name="OID">
<connection url="ldap://my.oid.com:389"
binddn="cn=orcladmin" password="passwd" encrypted="false"/>
</provider>
</configuration>
</configurations>
</ISConfiguration>
Note the provider type --> provider providerType="JAZN"
You use LDAP -> this is for third-party ldap servers
For start I would suggest to try to adapt this sample to your OID , and see how it works . -
Javac compiler Error - cannot resolve symbol - symbol StringBuilder?
Hi ,
I am using hp - ux system with java version "1.4.2.06". when i try to compile a program called CharSequenceDemo.java which is found in the java tutorials at this link
[CharSequenceDemo.java|http://java.sun.com/docs/books/tutorial/java/IandI/examples/CharSequenceDemo.java]
i get the following error:
$/opt/java1.4/bin/javac CharSequenceDemo.java
CharSequenceDemo.java:38: cannot resolve symbol
symbol : class StringBuilder
location: class CharSequenceDemo
StringBuilder sub =
^
CharSequenceDemo.java:39: cannot resolve symbol
symbol : class StringBuilder
location: class CharSequenceDemo
new StringBuilder(s.subSequence(fromEnd(end), fromEnd(start)));
^
CharSequenceDemo.java:44: cannot resolve symbol
symbol : class StringBuilder
location: class CharSequenceDemo
StringBuilder s = new StringBuilder(this.s);
^
CharSequenceDemo.java:44: cannot resolve symbol
symbol : class StringBuilder
location: class CharSequenceDemo
StringBuilder s = new StringBuilder(this.s);
^
4 errors
Please help on how to compile this program.I've been struggling with the same issue. The difference is that my system says I'm using version 1.6.0_05. I've tried running jucheck.exe. It tells me I've got the latest version installed.
Here is the code:
import java.lang.StringBuilder;
import java.util.Formatter;
public class UsingFormatter {
public static void main(String[] args) {
if (args.length != 1) {
System.err.println("usage: " +
"java format/UsingFormatter <format string>");
System.exit(0);
String format = args[0];
StringBuilder stringBuilder = new StringBuilder();
Formatter formatter = new Formatter(stringBuilder);
formatter.format("Pi is approximately " + format +
", and e is about " + format, Math.PI, Math.E);
System.out.println(stringBuilder);
}When I type javac UsingFormatter.java, I get:
UsingFormatter.java:1: cannot resolve symbol
symbol : class StringBuilder
location: package lang
import java.lang.StringBuilder;
^
UsingFormatter.java:2: cannot resolve symbol
symbol : class Formatter
location: package util
import java.util.Formatter;
^
UsingFormatter.java:14: cannot resolve symbol
symbol : class StringBuilder
location: class UsingFormatter
StringBuilder stringBuilder = new StringBuilder();
^
UsingFormatter.java:14: cannot resolve symbol
symbol : class StringBuilder
location: class UsingFormatter
StringBuilder stringBuilder = new StringBuilder();
^
UsingFormatter.java:15: cannot resolve symbol
symbol : class Formatter
location: class UsingFormatter
Formatter formatter = new Formatter(stringBuilder);
^
UsingFormatter.java:15: cannot resolve symbol
symbol : class Formatter
location: class UsingFormatter
Formatter formatter = new Formatter(stringBuilder);
^
6 errors
The compiler refuses to recognize the symbols StringBuilder and Formatter.
I have spent hours googling for an answer and trying every suggestion. Nothing works, not even the one about dropping the computer from the rooftop.
Ultimately, what I'm trying to accomplish (in a different program) is to use a text file as a form letter template and replace the %s placeholders with stings from my form object.
Any advice?
Edited by: javastudent_99 on Apr 3, 2008 1:48 PM -
[stupid]error: cannot resolve "libusb1", a dependency of "libdc1394"
Hi!
:: Starting full system upgrade...
resolving dependencies...
error: cannot resolve "libusb1", a dependency of "libdc1394"
error: failed to prepare transaction (could not satisfy dependencies)
:: libdc1394: requires libusb1
I needed libdc1394 only for gstreamer-plugins-bad, so I removed those. Wanted to try out if I need them anyway. But... What if? Is this a bug, did I do something wrong or did I just update while the required version isn't up yet and should unset testing again?
EDIT: Uh, sorry, yes, I guess that's just me not waiting for the files to be distributed to the servers I guess.
EDIT2: At least looks like it, should wait & think instead of type and type. Me drinking to much coffee. Marking thread as "stupid" instead of "solved" now.
Last edited by whoops (2009-05-03 23:18:02)I do not thing archbang is officially archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
pacman -S openbox
on arch; it does not seems to justify a fork (but please correct me if I am wrong).
Last edited by olive (2012-06-17 22:00:23) -
Cannot resolve symbol : import
I've never had this type of error while doing a compile before.
Does this mean that java doesn't know where to find my org.nipr.gateway_ws.utils.ConnectionPoolSingleton?
[javac] Compiling 1 source file to C:\Data\StateProcessWebService\Server\build\war\WEB-INF\classes
[javac] C:\Data\StateProcessWebService\Server\src\org\nipr\StateProcess\impl\StateProcessImpl.java:20: cannot resolve symbol
[javac] symbol : class ConnectionPoolSingleton
[javac] location: package utils
[javac] import org.nipr.gateway_ws.utils.ConnectionPoolSingleton;
[javac] ^
[javac] C:\Data\StateProcessWebService\Server\src\org\nipr\StateProcess\impl\StateProcessImpl.java:265: cannot resolve symbol
[javac] symbol : variable ConnectionPoolSingleton
[javac] location: class org.nipr.StateProcess.impl.StateProcessImpl
[javac] ConnectionPooler pool = ConnectionPoolSingleton.instance( "stateProcess" );
[javac] ^Cool. Thanks.
I freaked when I first saw that. I added the missing java file and it compiled just fine. -
JSP Compilation Problem - Cannot Resolve Symbol
I cannot see the problem. Maybe I am not sober at 2:30 am.
<%
Collection postBeans = ( Collection )request.getAttribute( "PostBeans" );
Iterator iterator = postBeans.iterator();
int i = 0;
while( iterator.hasNext() )
PostBean postBean = (PostBean)iterator.next();
i++;
String background;
if ( postBean.getParentPostID() == 0 )
background = "#FFCE9C";
else
if ( ( i%2 ) != 0 )
background = "#EEEEEE";
else
background = "#FFFFFF";
%>
<table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
<tr bgColor=<%=background%>>
</tr>
</table>I got compilation error: cannot resolve symbol
symbol: backgroundI put the variable 'background' outside the while loop. The 'cannot resolve symbol' problem is gone. But, I got another compilation error:
>
unexpected type
required: variable
found : value
out.write("\r\n }\r\n i++;\r\n if ( postBean.getParentPostID() == 0 ) \r\n {\r\n background = \"#FFCE9C\";\r\n }\r\n else \r\n {\r\n if ((i%2) != 0) \r\n {\r\n background = \"#EEEEEE\";\r\n } \r\n else \r\n {\r\n background = \"#FFFFFF\";\r\n }\r\n }\r\n%>\r\n");
The code looks like:
<%
String background;
Collection postBeans = ( Collection )request.getAttribute( "PostBeans" );
Iterator iterator = postBeans.iterator();
int i = 0;
while( iterator.hasNext() )
PostBean postBean = (PostBean)iterator.next();
i++;
if ( postBean.getParentPostID() == 0 )
background = "#FFCE9C";
else
if ( ( i%2 ) != 0 )
background = "#EEEEEE";
else
background = "#FFFFFF";
%>
<table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
<tr bgColor=<%=background%>>
</tr>
</table> -
Problem : Cannot resolve the collation conflict between ...
Hi
I want select a column from another database base on my current field on current database.
here is my query :
select ms.ServiceID, ms.ServiceName, ms.CoefficientFixedService,
(select Services_Name from MpAdmisson..IAServices_Table where Services_DepartmentID=24 and Services_Name=ms.ServiceName) as N'MpServiceName'
from MedicalServices ms
join MedicalCategories mc on ms.MedicalCategorizationID=mc.MedicalCategorizationID
join Zones z on mc.ZoneID=z.ZoneID
where z.ZoneID=24
but I'm facing this error :
Cannot resolve the collation conflict between "Persian_100_CI_AI" and "Arabic_CI_AS" in the equal to operation.
Also i changed collation of "MpAdmisson" db to "Persian_100_CI_AI" and even restart msSqlServer service, but i'm facing the same error!
where is my problem and how to solve it ?
thanks in advance
http://www.codeproject.com/KB/codegen/DatabaseHelper.aspxalthough you changed the collation of the database it does not mean that all the objects changed their collation too automatically.
So far you are correct.
The change is only done when you change the data within the objects, thus recreating the table and moving data in / out or touching each and every value with doing something on the values themselves (the following will not work UPDATE (..) SET ServiceName
= ServiceName, the optimizer is smart enough too see that as a noop).
However, this is flat wrong. This is the story: each character column in a database has a collation tied to it. When you change the collation of a database, you change 1) the collation of the columns in the system tables. 2) The default collation. To change
the collation on the individual columns, you need to alter the column:
ALTER TABLE IAServices_Table
ALTER COLUMN Services_Name <current data type> COLLATE Persian_100_CI_AI [NOT] NULL
Unfortunately, this only works if the column is not indexed and has no constraints tied to it. Any indexes have to be dropped and recreated after the ALTER statement. If the column is a key column and there are referencing foreign keys, they also have to
be dropped and recreated. Thus, this is quite a far-reaching operation. And it may not stop there - with some amount of bad luck, constraints may fail with the new collation.
For this reason, this workaround suggested by Jens, may be your only option in the short term:
If you cannot do this currently, you can still do the following and collate on a per query basis:
select ms.ServiceID, ms.ServiceName, ms.CoefficientFixedService,
(select Services_Name from MpAdmisson..IAServices_Table where Services_DepartmentID=24 and Services_Name=ms.ServiceName COLLATE Persian_100_AS_CI) as N'MpServiceName'
from MedicalServices ms
And this part of Jens's post is correct. To note though is that use of the COLLATE clause voids any index on ServiceName. (Since this index is sorted according the rules of Arabic, and not the rules of Farsi.)
Erland Sommarskog, SQL Server MVP, [email protected] -
I have a project I created earlier this year in panini/burrito, but when I upgraded to CS5.5 I get 18 of the the following errors:
"Cannot resolve attribute 'clear' for component type flashx.textLayout.elements.SpanElement. Main.mxml /imagine/src line 406 Flex Problem"
I'm not very kbowleadgeable in flaex, so I'm trying to muddle through this.
Here's the active site by the way.
www.imaginenewmedia.com
It seems to be related to lines of code which lay out text on the "packages" page.
thanks!fixed! removed offending parameters from code.
-
Cannot resolve Java variables - a Nitrox bug?
Hi. I just installed Nitrox 2.0 to try it with my project. Quite a lot of JSP code shows up as having syntax problems - vairous variables show up as "cannot be resolved" in Eclipse "Problems" tab.
I narrowed down the problem to the following:
<script>
<%String myVar = "Hello";%>
</script>
<%out.println(myVar);%>
myVar is inidcated as "unresolved" in the println statement. Basically if any Java vars are declared inside <script> tags, Nitrox cannot resolve them outside the tags.
My Eclipse version is 3.0.1Putting the scriptlet before the script tag isn't always an option, though.
Here's an example where I'm doing the typical prefetch of a set of images (so they're in browser cache). The logic:iterator tag is used to traverse a collection that has the image info and to construct the necessary javascript.
<script language="JavaScript" type="text/javascript">
var previews = new Array();
var previewImg;
<logic:iterate id="item" ...>
previewImg = new Image();
previewImg.src = '<%= item.getPreviewImgSrc() %>';
previews[ '<%= item.getName() %>' ] = previewImg;
</logic:iterate>
</script>
In the above example, NitroX complains that "item cannot be resolved", but the "item" bean is defined inside the script tag as part of the logic:iterate tag.
Any suggestions?
Maybe you are looking for
-
On my laptop i had itunes but recently i needed to delete everything on my laptop including itunes. When i went to update the music on my iphone i re downloaded itunes but when i plug in my iphone a message pops up saying my phone is connected to ano
-
Adobe Acrobat Text Field Help.
How do you change the justification of text in a text field box created in Adobe Acrobat 9 Pro The default setting is left centered, I currently want it to be left top justified, how do I achieve this? Thanks in advance. st333vo PS heres a screenshot
-
Unzip files from FTP using ABAP
Hi All, I have the a requirement to unzip certain files from ftp and transfer the extracted files to another directory in ftp. Searched (Re: Unzip file;) in SDN but didnt find the perfect solution Appreciate the help. Regards Siva
-
i have a number of java permissions associated with the oracle.aurora.rdbms.security.PolicyTablePermission type that i would like 'disabled': select * from user_java_policy order by type_name, name; GRANT TANTALIS oracle.aurora.rdbms.security.PolicyT
-
JSP - Nested Jakarta Struts Logic Tags
Hi, Simple question.... Can Jakarta Struts Logic tags be nested when coding JSP's i.e. ========================================== <logic:iterate id="searchSizeTracker" name="searchSizeTracker" type="uk.co.troutlure.bom.SearchTrackerObject" scope="req