Generated CXF client would not compile with Java 1.5 on Eclipse - eclipse

Today I generated a webservice client with CXF 2.6.1 (latest version), using the tool wsdl2java provided. I want to compile the generated classes with Java 5 on Eclipse but it fails because of the following imports:
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
The CXF FAQ states that I can use it with Java 5. So I don't understand why it wouldn't compile in Eclipse.
I asked for a build.xml to be generated. When I run ant with that script, it works. The build.xml be found by downloading CXF 2.6.1 or inline as a template (easy to understand; the ant-target to use is build). From it, I deduced I needed to grab the following libraries, which I did and put in my eclipse project.
cxf-manifest.jar
geronimo-jaxws_2.2_spec-1.1.jar
jaxb-api-2.2.6.jar
So how can I get it compiling in Eclipse? What libraries, if any, am I missing?
Notes:
I have to use JDK5 to both compile and run.
My version of Eclipse is 3.7.
I have Java 6 installed, but my JAVA_HOME points well to my JDK5 instance. When I type set in a Windows command prompt, there is no reference to my Java 6 installation folder.

I don't need to copy the CXF libraries, just to link them inside my project. That works, since cxf-manifest.jar is a jar file with nothing in it except for a classpath which in turn loads all the libraries of CXF.

Related

Java failed to bootstrap path, eclipse, jdk-13

I’m trying to update my JavaFX project to be compatible with JRE 13 (until now it was set up to use JRE 1.8). I’m developing with Eclipse 2020-03, using a Mac.
The first big issue I’ve had to deal with is the migration from the included JavaFX libraries in JDK 1.8 to having to import JavaFX (14) as an external package for JDK 13.
The second issue is migration from using the classpath to using the modulepath. I’m new to the module path, so what I say about it may not make sense, but my current setup now is this:
modulepath:
<list of other .jar files>
JRE System Library [Java SE 13 [13.0.2]]
JavaFX 14
<list of .jar files I downloaded, including javafx-swt, javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing, javafx.web>
<I created a User Library from the above listed .jar’s>
Finally, all the compiler errors are now gone (I had to recompile some of the external .jar files I downloaded so there weren’t any split packages), but when I build and run the application class nothing happens.
Checking the Mac system console, the below output seems to reference why the app is not starting, but I checked he JDK path and the referenced java executable does exist.
com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.pid.java.40558): Failed to bootstrap path: path = /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java, error = 2: No such file or directory
What is happening here? If you need more info about my project config, comment and I can add details.

The package org.openqa.selenium is accessible from more than one module

I'm using:
Firefox 56.0.1
Selenium 3.6.0
Windows 10 home edition
Gecko Driver 0.19.0
The error message is
The package org.openqa.selenium is accessible from more than one
module: client.combined, net.bytebuddy"
This happens when you have added the external jars in the ModulePath.
Solution:
Remove the external jars from the node "Modulepath".
Select the node "Classpath" then add the external jars.
Review that all the jars are under the node "Classpath".
The problem is that you are adding .jar files to your Modulepath instead of Classpath.
Go to
Project → BuildPath → Config BuildPath
click Remove Jars from Modulepath
then click on classpath → Add external selenium jar files
Add all the required jar files inside classpath instead of module path. The same issue was also occurred with me but after adding the jars to classpath it got resolved.
I don't know anything about Selenium, but it looks like you have two modules that contain the exact same package name inside of them:
client.combined
net.bytebuddy
So when you say e.g. import org.openqa.selenium.WebDriver Eclipse doesn't know if you want to use that package from client.combined or from net.bytebuddy.
You need to either add a prefix in that import statement that will specify whether you're importing package org.openqa.selenium from client.combined or from net.bytebuddy.
You can possibly do this by just doing:
import client.combined.org.openqa.selenium.WebDriver
import client.combined.org.openqa.selenium.firefox.FirefoxDriver
or
import net.bytebuddy.org.openqa.selenium.WebDriver
import net.bytebuddy.org.openqa.selenium.firefox.FirefoxDriver
You can also try removing either of the packages (client.combined or net.bytebuddy) from your project
Add required JAR in class path instead of module path. Also delete unnecessary JARs which might have reference to the mentioned package.
I had the same error and removing the reference to one of the jar files solved the issue.
Remove the reference to one of the jar files that you added in java build path.
From the screen shot that you added I see you have reference to both
client-combined-3.6.0-sources.jar
and
client-combined-3.7.0.jar
both the packages have the same classes implemented.
Remove the reference to one and see if that help.
I had the same issue. I used JDK 9 and eclipse oxygen 64-bit version (Selenium 3.9.1). My first thought, it is the JDK 9, but I tested on IntelliJ IDEA JDK 9 and worked without any problem. So I installed the eclipse oxygen 32-bit version with JDK 8 (-no JDK 9 version on 32 bit) and the problem disappeared.
this happens when same java package code (package name + class name) is available in more than one jar file; for default modules every jar is exposed as Module. Modules essentially can not have same package name exported. This is more of a code cleanup task.

Chisel: Compiling Chisel library on Windows

I have been using sbt on windows and a custom build.sbt script in conjunction with an import Chisel._ in the top-level file in order to generate Verilog from my Chisel source successfully.
I'm trying to get an IDE working on Windows to expedite Chisel development. I've gone with the Eclipse based SCALA IDE http://scala-ide.org/download/sdk.html/
I want to compile the Chisel library so that the import Chisel._ can be resolved locally, without having to go off and download the source from the repository each timeand recompile the source. When I download the Chisel-master repo from Git and include the src\main folder in my SCALA project in the SCALA IDE, I get lots of syntax errors in the Chisel SCALA files that prevent me from building the project.
Has anyone done anything like this before on Windows or have any knowledge of working with the SCALA IDE as it may just be a case of undefined symbols in the project configuration?
Not sure exactly what you did with build.sbt respect to recompile (I think it download it only the first time, then it caches it for the future). But I'm using ScalaIDE for Chisel on linux, using the default build.sbt files, maybe you can try to get it working out of the box first to help narrow down the issue.
Here are the steps I took in order to get ScalaIDE work with Chisel:
the latest Scala IDE uses 2.11.8, the current Chisel repository defaults to 2.11.7. So I had to change all the build.sbt reference to scalaVersion from 2.11.7 to 2.11.8
I used sbteclipse
https://github.com/typesafehub/sbteclipse
To create importable the workspace to setup the compilation dependencies.
Except for chiselFrontEnd. For some reason, this package is not added to the dependency. I have to Add chiselFrontEnd as a javabuildpath dependency manually (Properties/JavaBuildPath, under Projects) for my own projects.
To resolve undefined symbols, you can also add a JAR onto the project build path using Project Properties > Java Build Path > Libraries > Add External JARs...
If you are getting your JARs through Maven / SBT, they should be in:
C:\Users\<name>\.ivy2\local\edu.berkeley.cs\chisel3_2.11\jars
If you are using publish-local with chisel3, your JARs should be in
C:\Users\<name>\.ivy2\cache\edu.berkeley.cs\chisel3_2.11\jars
Note that chisel3 is compiled into one JAR, including coreMacros and chiselFrontend sub-projects
Of course, this is a more quick-and-dirty solution compared to something that can parse SBT files.

Thrift: the import javax.annotation cannot be resolved

I use Eclipse Mars (M1) as my IDE. Today, I generated my service's Java code using Apache Thrift 0.9.2 (latest stable version) for an Android project. This version (unlke version 0.9.1) uses the "Generated" annotation from javax.annotation package, for adding some extractable documentation. It adds a line like the following line before each generated class:
#Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2014-11-30")
But surprisingly, Eclipse complains about the package javax.annotation. It throws the error "the import javax.annotation cannot be resolved". My project's Java compiler compliance level is 1.6, and its minimum Android API version is API 8 (Android 2.2). How can I fix this error?
Unfortunately most of packages under javax.* are not included in Android's JDK, therefore you need to add those that you need, manually. Here the reason for not including these packages is explained.
Unluckily, there are several versions of javax.annotation package available for download, some of which don't contain the "Generated" annotation class (javax.annotation.generated). Fortunately this jar file does include that specific annotation class. So if you don't use any build system like Gradle, Ant, or Maven, all you have to do is to include the .jar file in a directory in your project (e.g. lib/) and then add this jar library to your buildpath. If you use Ant, then follow the first link.
I had the same problem and I fixed it by adding this dependency to my build.gradle file
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'

org/eclipse/e4/ui/model/application/ui/MUIElement Class Not Found , Java Eclipse Juno

I am doing a CIMTool project, for a handle of WorkbenchWindow
Code Snippet
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
//(both these Classes are present in Libraries)
IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Issues
Following Error is slapped
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/e4/ui/model/application/ui/MUIElement
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:90)
Environment
Eclipse : Eclipse Java EE IDE for Web Developers, Version: Juno Service Release 2
OS : MS Windows 7 Professional, X86
Java Version : java version "1.7.0_25"
Questions
I tried searching for org/eclipse/e4/ui/model/*, I could not find in
Archives. Where I can find ?
Is there any otherway to get IWorkbenchWindow Instance ? (want to
avoid this issue)
This problem I found that, doesnt appear in Java Indigo. But my project has to be developed in Eclipse , so I cant migrate.
thanks
I also was confronted with this error when executing code from within a project that was created as "SWT/JFace Java Project" using Eclipse Kepler (displaying a ListSelectionDialog).
The main problem is that the project set-up misses a JAR file that contains the MUIElement class. You can easily fix the project set-up by editing the build-path, adding the external jar which has a name similar to this one:
org.eclipse.e4.ui.model.workbench_1.0.1.v20131118-1956.jar.
You find that jar in the plugins directory of your Eclipse installation.