org.jdom.Document cannot be resolve. It's indirectly referenced form required .class file - jdom

I try to work on RSS and receive the following error: org.jdom.Document cannot be resolve. It's indirectly referenced form required .class file.
I already added the jdom jar to my build path and tried different version but nothing worked.
I checked in the jdom jar, org.jdom.Document is not there, but jdom.src.org.jdom is there instead. If I extracted the source code of the jdom lib to my project and changed the package name to org.jdom, it would resolve the error.
However, I want to use the jar file only, not the actual source.Can anyone help me to resolve the error? Thanks!

Instead of JDOM 2,x, after download JDOM 1.1.3 and added the build/jdom-1.1.3.jar file into Eclipse build path, it fixed the problem.

I see you 'have it fixed'.... but, in case anyone else runs in to the same issue....
I expect that you have the jdom.zip file, not the jdom.jar file. The jdom.zip file is the distribution, and in the jdom/build directory you will find the actual jdom.jar file (or, depending on the version, jdom-1.1.3.jar ).
JDOM 2.x has a different release format (a zip file with a few jars....).
It is confusing, thus the different release format in 2.x
Rolf

I had the same issue and found that the Document or other classes which I was trying to import got changed under jdom2 in my jar. ie downloaded the jdom jars and added in my build path. So to import i changed to "import org.jdom2.Document" instead of "org.jdom.Document".
Check the class files in your jar package "jdom-2.0.6.jar" or in your specific version.
Dennis

Related

Where are the JarFiles and how can I add them into Selnium?

Downloaded latest extentreport jarfiles zip folder and extracted them. I see only two folder as displayed in the imageClick here and sub-folders contain lots of class file
I want to add the latest jarfiles to my project. Although, I could make use of Maven Project but wanted to do it manually by adding those downloaded jarfiles. Unfortunately, I could not find any jar files. There are java class files, properties file,pom file etc..but no jar files. Am I missing something or there is some way extract jars or add the META-INF folder to the project
While running the project i'm getting this error below. As I understood, its a runtime error since the class files are not available but its available during compiling
java.lang.NoClassDefFoundError: freemarker/template/TemplateModelException
Please suggest

The following configuration files were considered but not accepted:

I am new in Cmake thats why I will write story detailed.
I trying to build one lib under windows and that lib depends on other lib. (libmatroska depends on libebml) source libmatroska and source libebml
Fortunately both libs can be build with cmake.
I built libebml successfuly with cmake. And also built binaries using VS studio.
Then I tried to deal with libmatroska:
During first try I got:
Could not find a package configuration file provided by "Ebml" (requested
version 1.3.5) with any of the following names:
EbmlConfig.cmake
ebml-config.cmake
at libebml sources I found EbmlConfig.cmake.
I Type export Ebml_DIR=D:/work/mkv/libebml and try again.
On second run I got:
Could not find a configuration file for package "Ebml" that is compatible
with requested version "1.3.5".
The following configuration files were considered but not accepted:
D:/work/mkv/libebml/EbmlConfig.cmake, version: unknown
And after few hours I am still stuck on it.
I can't understand root of this error.
Is it something wrong with EbmlConfig.cmake?
... or maybe I specified path to wrong *.cmake file?
... or I need to install libebml some how before handling libmatroska?
I will be happy for any clue.
UPDATE:
Here EbmlConfig.cmake context:
include(${CMAKE_CURRENT_LIST_DIR}/EbmlTargets.cmake)
Where EbmlTargets.cmake is file generated while Ebml compilation.
I tried to change path inside EbmlConfig.cmake to global path. But got same error.
Also when I delete context of EbmlConfig.cmake I still have same error.
It looks like "default error when something goes wrong"

Why is my library not being recognized after importing my project?

I'm using the JDBC library in my IntelliJ project (mysql-connector-java-5.1.40-bin.jar)
I put it into a folder named lib and used right click > Add as Library to add it as a library. It worked fine.
Later, I zipped the project and moved it to another computer. After unzipping it and importing it in IntelliJ, it gave me the error SQLException: No suitable driver found for jdbc:mysql, which means that it couldn't find the library.
I looked through the file explorer in IntelliJ and it showed both the jar and XML file, and the XML file was pointing to the right location (jar://$PROJECT_DIR$/lib/mysql-connector-java-5.1.40-bin.jar).
I added the jar file as a library again and now it works. But how can I make it work without having to readd it each time?
Use Gradle (or Maven) for building and dependency management. IDEA should import a Gradle (or Maven) project just fine.
The problem was that I was overwriting the IntelliJ Module Library (.iml) file.
When you import a project to the same folder, IntelliJ asks you whether you want to overwrite or reuse the IML file. Since Overwrite was the default option, I selected it, but that caused it to forget what libraries it was using.
By choosing Reuse instead, it works perfectly.

Can not find LucenePDFDocument class in pdfbox-2.0.2.jar

I want to parse pdf document to be indexed by Lucene using pdfbox package. The required class LucenePDFDocument which is in org.apache.pdfbox.examples.lucene.LucenePDFDocument package. But in the jar file I have not found it. So, my java program is not getting compiled.
Kindly help!!!
The answer of the question goes as follows...
Previously before pdfbox version 1.7.1, org.apache.pdfbox.examples package was included but there is no package as examples.lucene.LucenePDFDocument.
From 1.7.1 there is no org.apache.pdfbox.examples package.
So, in order to use LucenePDFDocument class in your application, one has to compile the source and make a jar and use it in the application. In the source there is a example package directory. So, example package will be included once compiled from source.

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

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.