I have a vaadin6 application that I have to upgrade to vaadin7.
I used this document to understand vaadin6 to vaadin7 migrating:
https://vaadin.com/wiki/-/wiki/Main/Migrating+from+Vaadin+6+to+Vaadin+7
Then I tried to build the application (with maven2) with vaadin7.0.0.alpha3 repository.
Obviously many errors appears because of the differences between vaadin6 API and vaadin7 API.
One of those errors that I have to correct is:
cannot find symbol
symbol : method getMainWindow()
location: class com.vaadin.Application
What I understood is that I have to use com.vaadin.ui.UI instead of com.vaadin.Application.
But the problem is that when I add
import com.vaadin.ui.UI;
Then I tried to build again this error appears:
[ERROR] D:\aperte-workflow\core\gui-commons\src\main\java\org\aperteworkflo\util\vaadin\VaadinUtility.java:[53,20] cannot find symbol
symbol : class UI
location: package com.vaadin.ui
I'm sure that I'm using vaadin7.0.0 repository. I checked also that com.vaadin.ui.UI class exists in the repository that I'm using:
https://vaadin.com/api/7.0.0/com/vaadin/ui/UI.html
So what's the problem?
Related
I moved my antlr4 based project which uses 6 different grammers to a different folder (and github depository). Now when I try to rebuild the Java project in I'm getting errors such as
Error:(30, 39) java: cannot find symbol
symbol: variable CharStreams
location: class com.applitools.ekb.PhpExtractInterfaceTool
even though the code includes
import org.antlr.v4.runtime.*;
and in a different grammar, it is even more explicit
import org.antlr.v4.runtime.CharStreams;
In the latter case, InteliJ (2019) colors CharStreams in red and says "cant resolve CharStreams"
All I did is copy the project over and all works as expected in the original project. I tried to unistall and then reinstall the antlr4 plugin - didn't help.
I downloaded/installed protocol buffers 3.1.0 and used protoc to compile a .proto file which generated a .java class for me.
With this change, everything works/compiles.
Then I replaced the avro jars with their latest versions and tried to compile my project again, but no luck, it's complaining this error:
# Compile: pregen/media.proto
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:828: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:2669: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
pregen/media.proto/serializers/protobuf/media/MediaContentHolder.java:4131: error: cannot find symbol
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
^
symbol: class OneofDescriptor
location: class Descriptors
3 errors
I did a lot search/research and still no luck, also looked at this most relevant post: Problems using protobufs with java and scala
and then I compiled my generated .java file along with protobuf.3.1.0.jar into a new jar and placed it under my lib/, but the project still cannot compile.
Any help on how to resolve this issue please?
(I'm using an open-source project to benchmark Java serialzation performance, and I've posted a more detailed question/issue there as well.)
One of the authors of that open source projects helped me resolve the issue, copy the solution here as well:
"The problem was that avro-tools-1.8.1.jar bundles some of the Protobuf
class files (ugh). The bundled class files aren't compatible with the ones
our generated Protobuf code relies on.
We're pretty fast and loose with what's on the classpath; we just include
"lib/*.jar". It would be nice to be more precise with dependencies at some
point.
But as a quick fix, I put avro-tools-1.8.1.jar in "lib/extra/", so it won't
get picked up by default. The Makefile now specifically references that
JAR only when we need to run the Avro code generator."
Thanks.
I am building Mopub SDK as a module using Intellij Idea.
I have copied test-assert-core-2.0M10.jar to libs folder under Mopub. However, when building it, the line import org.fest.assertions.api.ANDROID; shows red color at the word "ANDROID". Compilation error message says:
Error:(20, 31) java: cannot find symbol
symbol: class ANDROID
location: package org.fest.assertions.api
Have searched, but found nothing about this particular error.
Anybody using Mopub under Intellij Idea can offer some hint? Thanks!
I've found the solution. I deleted all files under /mopub-sdk/src/test, and it builds successfully.
I'm trying to compile Eclipse JDT - Abstract Syntax Tree (AST) and the Java Model - Tutorial using command line.
I came up with this command line based on the name match in plugins directory in eclipse indigo.
javac -cp .:\
org.eclipse.core.runtime_3.7.0.v20110110.jar:\
org.eclipse.equinox.common_3.6.0.v20110523.jar:\
org.eclipse.core.commands_3.6.0.I20110111-0800.jar:\
org.eclipse.core.resources_3.7.100.v20110510-0712.jar:\
org.eclipse.jface.text_3.7.1.r371_v20110825-0800.jar:\
org.eclipse.jdt.core_3.7.1.v_B76_R37x.jar:\
org.eclipse.jdt_3.7.1.v201109091335.jar \
SampleHandler.java
The problem is that I still get these 4 errors.
SampleHandler.java:19: cannot find symbol
symbol : class Document
location: package org.eclipse.jface.text
import org.eclipse.jface.text.Document;
^
SampleHandler.java:28: cannot access org.eclipse.core.runtime.jobs.ISchedulingRule
class file for org.eclipse.core.runtime.jobs.ISchedulingRule not found
IProject[] projects = root.getProjects();
^
SampleHandler.java:87: cannot find symbol
symbol : class Document
location: class handlers.SampleHandler
Document doc = new Document(unit.getSource());
^
SampleHandler.java:87: cannot find symbol
symbol : class Document
location: class handlers.SampleHandler
Document doc = new Document(unit.getSource());
^
4 errors
I had much more errors, but with the help of this hint, I could add org.eclipse.equinox.common_3.6.0.v20110523.jar to remove many errors.
It seems like that the jar name might not reflect the package import name.
How can I know what jar files should be added to remove the errors?
I found http://www.jarfinder.com pretty useful. Using this site, I could give the class name to find the jar name for available eclipse releases.
For example, I could search org.eclipse.jface.text.Document
By clicking the class, I could identify the name of the jar file.
Even though the newest eclipse information is not available, I could guess the jar name.
I am trying to "Mavenize" our existing Commerce solution. However, I am getting a weird error when I try to run mvn compile I get the following error.
[ERROR] /home/user/tmp/IBM/WCDE_ENT70/workspace/WebSphereCommerceServerExtensionsData/ejbModule/org/ecommerce/wcs/changerequest/ChangeRequestAccessBean.java:[347,32] cannot find symbol
[ERROR] symbol : method createAccessBeans(java.util.Collection)
[ERROR] location: class org.ecommerce.wcs.changerequest.ChangeRequestAccessBean
When I check the class it is related to the com.ibm.ivj.ejb.runtime.AbstractEntityAccessBean class which IBM has neglected to include JavaDoc for anywhere. I look into eclipse and it shows me the method in question was correct using code complete, however, it still fails with maven.
I am wondering if it isn't a customisation to the IBM jre (I am not using that for this POC) and if there is no way around it (short of extending the class and reimplementing).
Anyone?
Problem had to do with multiple imports of different versions of the same dependency. Now this has been resolved.