Some classes can't be resolved when compiling Apache Drill? - apache

I built the Drill project according to the wiki specification
but, the project has some errors. Some classes (BigIntVector, BitHolder,BigIntHolder) can't be resolved and the workspace don't really contain these class files. Any suggestions as to what's going on?

These clases are generated during build.
exec/java-exec/target/generated-sources/org/apache/drill/exec/expr/holders/BigIntHolder.java
There is a problem in that the Maven import into eclipse results in target/generated-sources/org being added to the Source Folder build path. I have found that in the two cases, comon and java-exec, if you remove these folders from the source folder build path and add them as target/generated-sources this will help.
This is a workaround, there is obviously a misconfigured pom.xml somewhere.

Related

Intellij Idea's Project view doesn't show all project files

a colleague of mine checked out a git repository from github which is an assignment for college. But he can't see all relevant files and folders in the project view. Any ideas for solving this issue would be highly appreciated...
Screenshot:
Thank you and best regards
Philipp
Most likely the project was imported into IDEA, but it's not a pure Java project.
Note that non-Java projects cannot be imported from the existing sources using the Import option.
You should create a new project, select the appropriate module type and then point to the existing directory with the code when creating the module.
Other options are to import from Maven/Eclipse/Gradle.
There is a known issue logged.
If it's not the case, please share a sample project (zipped) that will reproduce the problem.
In my case, project .iml file was not found. So I imported project to idea, and it imported project and created .iml file. All files and folders are visible now.

"Duplicate class found" - IntelliJ and .class files

I recently imported one of our company's project into IntelliJ Idea (10.5.1). We build and run the project using an ant build script and IntelliJ supports that just fine.
However, IntelliJ seems to have a distinct problem when the compile output directory equals the source code directory, ie .class files are placed in the same directories as their corresponding .java sources.
(Note that I am aware that is not a proper way to go, but tell my boss that. This project is over 15 years old and correspondingly large, too many things depend on it to be this way, there is nothing I can do about that.)
So once things are compiled, IntelliJ detects the .class files and adds them to the project tree. The problem here is that it considers them class declarations, thus I get a "duplicate class found" message for each and every class. This doesn't make me unable to work, but it is extremely annoying as you may guess.
I tried making the IDE ignore .class files, but apparently that makes it not load any classes at all, including the JRE runtime and anything else located inside of .jar files.
Is there any way to make IntelliJ Idea ignore .class files which are in the same location as their .java sources?
Make sure that you've configured the output directory to the source directory, disable the Exclude of the output directory to see your files.
I coped with this same problem when cloning a project from Bitbucket. To solve it in IntelliJ:
Project Structure > Modules > Source > Source folder > <<"Eliminate the unwanted source folder">>
In my case, I had non-implemented classes in one source folder and a second source folder with the implemented classes (same class names).
I deleted one, built again, and the problem got solved.
Give it a try!

Eclipse RCP: Dependencies correct (?) but get a NoClassDefFoundError

I have a RCP project where I cannot fix a NoClassDefFoundError: One plugin depends on another plugin. The plugin-dependencies are set in the manifest, packages exported, and there is no error at compile time. Both plugins are in the product dependencies and visible in the installation details of the product.
But when I run the application I get a java.lang.NoClassDefFoundError when the one plugin wants to use a class from the other plugin.
Any hints how to find the reason for this are greatly appreciated.
Thanks,
Michael
I found the problem: I created the plugin which could not be loaded from an existing Java project. And somehow I deleted the "." in the entry Bundle-classpath in the plugin manifest (the plugin has some jars which -> so lib/xyz.jar was in the Bundle-classpath entry but not the ".").
For the class-loader of the bundle the "." means to search for classes from the root path of the bundle (or something like that), so it could not find the classes. However, there were no errors in the IDE so it was hard to find.
Is the configuration for running the application correct i.e. all dependencies are also put in the running configuration?

intelliJ 9 cannot find class I specify in web.xml

I am trying to get logdigger to work in my java app that uses google app engine. I have tried putting my jar files in the src/ directory, lib/ directory, and no matter what I do, it can't find the class. The only thing that it finds is the com.google.appengine stuff. I have tried messing with my dependencies and it's not working. Has anyone done this before and gotten it to work? I am not sure how to modify the classpath through intelliJ (however in the project settings I have the jars linked as a dependency under the modules section).
You probably need to look at the artifacts for your project. IntelliJ separates runtime assembly of WARs into the artifacts section. Look and see that your WAR file is assembled properly. I'm guessing that you don't put the contents of the /lib directory into the WEB-INF/lib of your WAR. The compiled output ought to go into WEB-INF/classes. All other output belongs in the root of the deployment.

M2Eclipse can't find dependencies when they are projects in the same workspace

I know there are various known issues with the M2eclipse plugin and I guess this is just one of them. Hopefully someone is aware of a solution or workaround.
We have like 30 projects in our workspace but for clarity lets assume there are only 2: A en B.
B includes A as a dependency in the pom.xml of B.
The problem we have is that in eclipse the classes of A can't be found so you get compilation errors. However, if you 'mvn install' A to deploy it in the local repository and the close project A then everything is fine; no compilation errors. So, if A exists in the project M2Eclipse does not seem to be able to correctly set the classpath in eclipse.
To make things stranger, we also have project C that also depends (in exactly the same way as B) on project A but here we have no compilation errors. We can't identify anything meaningful difference between project B or C; as said, they include A in the same manner.
thanks for your help,
Stijn
P.S. I'm using version 0.10.2.20100623 of the plugin
I've experienced this behavior before, and it has occurred for me in the past when I imported or checked out the maven projects separately.
Prerequisite: make sure you have m2extras installed before you check out a multi-module Maven project: update site
First thing to try: right-click each project and choose Maven -> update project configuration. The plugin might be smart enough to detect that it could be building project references between the projects.
Second thing to try (if your 30 projects are all submodules off one root): this would be easiest, because you could use the SCM integration of m2eclipse to do a "Checkout as Maven Project..." on the root pom. M2eclipse would make a project for the superpom and for each submodule, with project references built appropriately.
Third thing to try: I'd try manually creating project references in the project settings of each project to mirror their interdependencies. It'd be a lot of work, and unless you check in your eclipse .project/.settings (eww), it would have to be done individually for each working copy.
RESOLVED
finally, after agonizing hours I found the cause.
I was focussing on the .classpath and the .settings files but the problem was located in the .project file. This file in project A was missing following entry in the tag natures:
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
Adding this resolved the issues.