I am trying to use dialogs with GWTQuery-UI in Kepler and can't figure out what is wrong. I followed as best I could the instructions found at https://code.google.com/p/gwtquery-ui/wiki/GettingStarted. I have the following code setup
gwt.xml
<inherits name='gwtquery.plugins.UiGoogleCdn' />
<inherits name='gwtquery.plugins.UiEmbedded' />
I have also tried the gwtquery.plugins.Ui but that hasn't solved things either.
In my java file I have the following
import static com.google.gwt.query.client.GQuery.*;
import static gwtquery.plugins.ui.Ui.Ui;
import com.google.gwt.query.client.Function;
I have the following in the html for the project.
<div style="display: none;" class="gwt-DlgBox">This is a test to see if this shows up</div>
In the main logic I have the following click handler
#UiHandler("btnShow")
public void btnShow(ClickEvent event)
{
int x = 0;
try
{
x = $(".gwt-DlgBox").length();
$(".gwt-DlgBox").as(Ui).dialog();
}
catch(Throwable e)
{
e=e; // just so I can debug break here.
}
}
When I debug I get the error: Line 80: Referencing method 'com.google.gwt.query.client.Function.f(Lcom/google/gwt/user/client/Event;Ljava/lang/Object;)': unable to resolve method
When I step through the code x = 1; which is correct, but the .dialog() line fails with the error mentioned above.
When I try and compile it I get the following error
[ERROR] Errors in 'jar:file:/C:/src/gwtquery-ui-r146.jar!/gwtquery/plugins/ui/UiWidget.java'
[ERROR] Line 80: Referencing method 'com.google.gwt.query.client.Function.f(Lcom/google/gwt/user/client/Event;Ljava/lang/Object;)': unable to resolve method
Any help would be appreciated. Yes I am new to GWT and just don't understand what I am missing.
Thanks.
If you are using gwtquery 1.4.2, then it could be the issue. I resolved it by downgrading to gwtquery 1.3.3.
Related
I am working on an AEM site and I am trying to get the page property teaserImage I have the follow in my Java class, but when I do a build I get a cannot find symbol error.
public String getTeaserImg() {
return this.getPageManager().getPage(url).getProperties().get("teaserImage").value;
}
But if I put a breakpoint on this similar function
public Page getPage() {
return this.getPageManager().getPage(url);
}
And then execute this.getPageManager().getPage(url).getProperties().get("teaserImage").value in an Evulate expression window it gives me the property, so I'm not sure why on build it doesnt work when it works in this scenario.
Cannot find symbol error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn't understand.
What does a "Cannot find symbol" or "Cannot resolve symbol" error mean?
In your example you are trying to get a property. If you can get that when you are debugging the code, that maybe means you forgot to add that property when you are trying to build the application.
So I'm trying to write a Java program using the SAP BO SDK. When I try to create a session, using a predefined class from the SDK, I get a nullPointerException. I copied my code 1 to 1 from an SDK tutorial. Here is my code:
public class Program {
public static void main(String[] args) {
try {
ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
...
}
}
}
When I run that code (I commented everything else out for testing), I get the following error:
Exception in thread "main" java.lang.NullPointerException
at com.crystaldecisions.celib.classloader.ClassLoaderHelper$2.getResourceAsStream(ClassLoaderHelper.java:102)
at com.crystaldecisions.celib.classloader.ClassLoaderHelper.getResourceAsStream(ClassLoaderHelper.java:149)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.initializeSystemProperties(SessionMgr.java:258)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.<init>(SessionMgr.java:253)
at com.crystaldecisions.sdk.framework.internal.CEFactory.makeSessionMgr(CEFactory.java:94)
at com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr_aroundBody0(CrystalEnterprise.java:121)
at com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr_aroundBody1$advice(CrystalEnterprise.java:512)
at com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr(CrystalEnterprise.java:1)
at myprogram.main(Program.java:18) <-- Line 4 in my code example above
Does this mean that there is an error in the libraries provided by the SDK? Or that I somehow imported those incorrectly? Is it possible to get any more information from this error code?
Thank you for any help or guidance you can provide.
EDIT: The tutorial used: http://bukhantsov.org/2011/08/getting-started-with-businessobjects-java-sdk/
The issue was that I was referencing JAR files directly from my Program Files. Copying the files to a local folder in my workspace, and referencing them from there fixed the problem.
i have been searching around for a few days for the answer to this and i just can't seem to get it to work. I have seen exact examples where it is working for them and I try exactly what they do and it is just not working for me.
Basically what i am trying to do is open a local access DB. I have tried numerous methods and this Jackcess seems by far the best library to use, so i am trying to get it to work with that. I have read their cookbook and gone through all of that, and still no luck so i am coming to you guys in the hope of finding a good solution (i have not posted this question anywhere yet). Here is my code (the relevant part)
The only syntax error i am getting is "DatabaseBuilder.Open" and the error is it cannot find the method, even though i have the libraries included for IO
import com.healthmarketscience.jackcess.*;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
Database db = DatabaseBuilder.open(new File("my.mdb"));
try {
Table table = db.getTable("Teams");
} catch (IOException ex) {
Logger.getLogger(Teams.class.getName()).log(Level.SEVERE, null, ex);
}
}
Any help would be greatly appreciated!
The program fails to debug once I have click this buttone the only actual message i can fine is
"Cannot find symbol
Symbol : Method Open(file)
Location : variable.DatabaseBuilder of type Object"
To use Jackcess you must have at least the following items in the build path for your Java project (or on your CLASSPATH):
the Jackcess JAR file itself, and
the JAR files for its two mandatory compile-time dependencies from Apache: commons-lang and commons-logging.
In the Eclipse IDE that will look something like this:
I installed the JavaCV/OpenCV libraries, and I'm having a problem with the basic example code.
According to several examples that I have looked at, this code should load an image:
IplImage image = cvLoadImage("C:\\img.jpg");
But, when I run that I get a "cannot find symbol" error.
Since this is my first time using it, I'm not sure if I messed the install up or not.
According to the newest JavaCV readme, I do have the correct version of OpenCV. I also have all the JavaCV jar files imported. As far as I can tell, I also have all the paths set correctly too.
Anyone know what the problem is?
Edit:
Full code:
import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import java.io.File;
public class demo {
public static void main(String[] args)
{
IplImage image = cvLoadImage("C:\\img.jpg");
final CanvasFrame canvas = new CanvasFrame("Demo");
canvas.showImage(image);
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
}
Error when I try to run it:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: cvLoadImage
at javacv.demo.main(demo.java:17)
Java Result: 1
Seems like it is claiming cvLoadImage doesn't take a string as an argument.
A walk around that i find for you is to load the image by ImageIO and passe it later to IplImage
e.g.:
BufferedImage img = ImageIO.read(new File("C:\\img.jpg") );
IplImage origImg = IplImage.createFrom(img);
This solved my problem: import static org.bytedeco.javacpp.opencv_imgcodecs.*;
You have to add this import statement:
import static org.bytedeco.javacpp.opencv_imgcodecs.cvLoadImage;
This is required so that the static method cvLoadImage can be used without using the class name.
You have to import com.googlecode.javacv.cpp.opencv_highgui.*;
With javacv 0,9 you have to import static org.bytedeco.javacpp.opencv_highgui.*;
I got the same error then, i imported the following package, problem solved.
import static com.googlecode.javacv.cpp.opencv_highgui.*;
This might be old but for those who stumbled upon this problem like me just now,
here is how I solved it and why:
First OP's error: Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: cvLoadImage at javacv.demo.main(demo.java:17)
This indicates that the compiler cannot find the cvLoadImage method that you are trying to call.
cvLoadImage is a static method under JavaCPP.
Specifically it is a static method under opencv_imgcodecs class.
To solve this issue one must first specify the import of the opencv_imgcodecs class.
This can be done by adding the import:
import static org.bytedeco.javacpp.opencv_imgcodecs.cvLoadImage;
This in turn would result for the opencv_imgcodecs class to be usable within your class along with its static methods and other functions.
I hope this helps.
Got the same problem recently.
if you are using javacv-0.10 (more recent at the moment), import manually this one:
import static org.bytedeco.javacpp.opencv_highgui.*;
but the source of JRE of the project should be higher than 1.5
In my case, the problem happened when the squeegee in debug mode.
Try to run in normal mode.
I am leaning selenium. I have trouble to run a sample script. Please help me to figure out what I did wrong. Thanks!
My installations:
JDK1.7.0._02
selenium-server-standalone-2.31.0.jar
Eclipse IDE 3.7.0
Selenium IDE 1.9.0 (Firefox plugin)
Eclipse indicates the following error message when I click on the package section in the code
1.the declared the package org.openqa.selenium.example; doesn't match expected package Seletest1
2. syntax error on token package, imported expected
Eclipse also suggested move Test1.java to package 'org.openqa.selenium.example
Please suggest the right action for me to take, should I imported org.openqa.selenium.example into the build path of my project or should I move Test1.java into the package?
where Can I find out the location of the package-org.openqa.selenium.example?
Here is my code copied from Google code get started with Selenium
my project structure SeleniumTest1>Src>SeleTet1
package SeleTest1;
package org.openqa.selenium.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class Test1
{
public static void main(String[] args)
{
// Create a new instance of the html unit driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit Google
driver.get("http://www.google.com");
// Find the text input element by its name
WebElement element = driver.findElement(By.name("q"));
// Enter something to search for
element.sendKeys("Cheese!");
// Now submit the form. WebDriver will find the form for us from the element
element.submit();
// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());
}
}
The error message showed when I execute the code
When I run the code in Eclipse, I received the following error message:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)
You have a duplicate package declaration on the top of your code. I would remove the second one (org.openqa.selenium.example) since your code is probably in the SeleTest1 folder.
Your package declaration is not required to match the one of the framework you are using.
When you export the selenmium IDE recorded test case into webdriver format, by default the package statement will get added as
package org.openqa.selenium.example;
We need to modify it as per our package name created in Eclipse.
So, in your case, you can remove the below duplicate line.
package org.openqa.selenium.example;
You will not get the 2nd error also once you have done this modification.