Package accessible from more than one module - java

I was trying to switch my project from java8 to java11. While switching I am facing the below errors:
Package accessible from more than one modules.
cannot be resolved to a type/variable. (Here is an dependent library)
I was looking forward for solution to resolve this. It will be helpful if I got any working example to understand better.

Related

Java.lang.verifyError when adding module to Android project

I'm adding a library to my project (a .aar) by using "Open module settings > new > Import .JAR/.AAR Package".
It builds correctly an the app opens but, when the first class of that library is being instantiated it gives me a "Java.lang.verifyError" with that class.
Reading about it it seems the error happens when the library used to compile is not the same as the one used at runtime. But that seems a little abstract to me, where can a I check if that happens? How should I correct it?
Thanks
Maybe your library modules use two version types of dependencies of same library types. Like, say you're using library A and B. Then A use support design 27 and B use 28. Make it same. Few days ago we faced this error by Java which is totally new to us. We were using library modules and after multiple research we found it and solved using same type of versions. I can't guarantee, it will work to you though.

wicket.version.undo package in Wicket 7.6.0

I am learning how to use wicket. I found this example, which I am trying to implement, but I`ve stumbled upon a problem with wicket.version.undo package. In the example, Change class from this package is used for pages versioning.
But when I try to import this package I get an error: The import can not be resolved
So I was wondering whether this package was replaced with something else in newer versions of the wicket? (my version is 7.6.0). Because I have found the jar of this package only for up to 1.6 versions.
I would be very grateful if someone could help me with this.
This article is very old!
The easiest way to solve such kind of issues is to remove the import from the code. This way the IDE will try to find the missing classes for you. If the classes are not available on the current classpath then modern IDEs will try to find it in Maven Central and suggest you to add another dependecy to the class path.
I don't have the IDE in front of me but I think the classes you need are in wicket-util module.

Conflicting CXF jar version between a Java project and a nested project

I have 2 java projects: capturingapp and epcis-queryclient. These are open source projects which I imported in Eclipse. capturingapp runs in Tomcat.
epcis-queryclient is nested in capturingapp (i.e. it is listed in the Projects tab in Java Build Path in Eclipse)
epcis-queryclient uses the cxf-rt-transports-http-2.2.9.jar library.
capturingapp uses the cxf-rt-transports-http-2.6.1.jar library.
I have an error at runtime: capturingapp calls a method present in epcis-queryclient which needs the ClientOnlyHTTPTransportFactory class (present in v2.2.9 of cxf), but it fails because it looks in v2.6.1 which does not contain that class anymore.
How could I solve this situation?
Thanks!
Roberto
These are open source projects
Great news!
How could I solve this situation?
I will tell you the best way to solve this problem!
You can update the code of epcis-queryclient to use cxf-rt-transports-http-2.6.1.jar, using your programming skills. I am sure they will be pleased to receive such a contribution!
But first check to see if they have already done it, in git master / SVN HEAD / hg tip, or in an experimental branch.

Android gradle import lots of errors and trouble

Im trying to get used to this new gradle system built into the new Android studio.
I've tried a really basic task, to import the websockets library into my project. So I imported the module via the normal route (File->Project Structure), I imported the java-websockets module in and added it as a dependency too. Finally I import the org.java_websockets class into my project.
My project ended up looking like this:
So this is where my problem starts, I give it a shot and try to build it and run into the usual gradle errors. So I added an 'include' line to my settings.gradle
include ':java-ws-client'
and another one into my build.gradle
compile project(':java-ws-client')
So now I find myself stuck with two problems:
One fairly undescriptive one:
and another:
I've tried updating my android studio to the latest one, and the project above is a fresh one.
How can I avoid pulling my hair out?
From your screenshot, settings.gradle is inside TestProjectProject, which makes TestProjectProject a root project. However, java-ws-client is parallel TestProjectProject, which is outside of TestProjectProject's scope. You cannot reference any project outside its scope using ":foobar" notation.
To fix the second problem, you should either move java-ws-client into TestProjectProject, or declare java-ws-client as an external dependency, and add proper repository resolver to find it.
To fix the first problem, make sure in TestProjectProject/build.gradle you have applied the Java plugin. The Java plugin creates the "default" configuration.

Strange problem with imports in Java Application

I'm building a plugin to extend the Eclipse BPEL Designer. That plugin is supposed to allow users to add meta information to certain model elements via EAnnotations. I already did the same thing for a BPMN model and it work just finde but when doing this for the BPEL designer I reveive rather strange exceptions.
The first I thing realized when trying to extend the BPEL Designer was that the designers plugins are defined in an unusual package structure. Instead of org.eclipse.bpel.xxx they have a "bin" in front of all package names. When I'm trying to import some of the designers classes I therefore have to refernce the bin path to make it work. However all the examples I was able to find just imported classes from the ordinary package structure.
Most of the time importing classes with the bin in front of the package name worked fine for me but every now and then I receive a strange error message. The message is in the form of: The type org.eclipse.bpel.xxx cannot be resolved. It is indirectly referenced from required .class files
It seems that Eclipse somehow can't find certain classes. I'm stuck at this point for over a week now and don't find any solution. From my point of view the problem has to be seen in the BPEL Designer plugins. Inside those plugins they reference classes in the form of org.eclipse.bpel.xxx but as I said when I reference those plugins their classes are inside packages with a "bin" in front of the normal package name. Could that be an explanation why certain classes can't be referenced by Eclipse and I get those strange error messages?
I'd appreciate any new ideas about that problem and hope that somwebody can give me an advice to solve that problem.
Cheers
Stefan
I already encountered in the past such troubles ...
I think there is a problem with the export/import of the BPEL Designer plugin.
How did you get this plugin ? Are you working with binary plugin or plugin imported as source in your SDk ?
Try to get again this plugin, may be an other version, or from an other source .. an update site.
I really think these "bin" packages/folders should not be here
Hope this can help ...

Categories

Resources