Build Path Exception using Spring 4.0.2 and eclipse kepler - java

I have the same problem mentioned at this SO question. I have tried to find the solution every where but could not find one.
Here is information about my environment
OS: Ubuntu 13.10
IDE: eclipse kepler 4.3
Spring version 4.0.2
I have jdk 8 installed on my machine and I am using JRE 1.7 for the project
I do have aspectjweaver dependency in my POM file
<dependency>
<groupId>aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.5.4</version>
</dependency>
I can find the class BCException using ctrl+shift+T
Please find the screen shot of my eclipse.

Related

spark-excel_2.10 package creating conflict with maven on Mac

This java package work fine on my Windows machine, but when I run this on my Mac machine it create conflict with maven; both machine have same version of maven. Can you tell me why it's happening, and can you give me the solution to this error?
Note: I already tried spark-excel_2.11 but same problem still.
<dependency>
<groupId>com.crealytics</groupId>
<artifactId>spark-excel_2.10</artifactId>
<version>0.8.3</version>
</dependency>

JAXB project to be compiled with JDK SE 8 but has to run also on JRE 11

I have a Java program I compile in Java 1.8 because it has - between others - because many users only have JRE 1.8. In that program I use javax.xml.bind.* quite often to marshall and unmarshall XML. To help users run it on JRE 9-10, I also provided a shell script that calls java with the -add-modules argument. For users that have Java 11+ (and no previous Java version installed), that won't work, will it?
So I thought of bundling JAXB (or EclipseLink Moxy) with my program and still compile it with JDK8 (with Eclipse IDE). So that I runs on Java 8 and still on Java 11+. Will that work?
Thanks!
here a solution add these dependencies to your pom.xml ( if u re using) maven :
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
and the code will compile in both version java 8 and 11.
Thank you for your comments and answers!
I finally got it running, though it is not perfect yet. This is what I did:
downloaded Jakarta JAXB 2.3.2 here: maven
unzipped it and put the content to my project directory
in Eclipse IDE 2020-6, I edited the properties of the project (Cmd+I):
Under the topic "Java Build Path", I added 3 jars with "Add External JAR": jaxb-impl.jar, jakarta.xml.bind-api.jar and jakarta.activation.jar
The part I obviously forgot before: also under "order and export", I checked that 3 JARs.
To test the result, I told Eclipse IDE under "Run/Debug", register "JRE" to run my main class with JRE 12.
That worked for me.

Maven plugin compatibility error with newest version of Java

So recently I was given a maven project I need to compile, but there seems to be some compatibility issues with wr04j and the most recent version of Java I have installed on my Mac.
Execution {redacted} of goal ro.isdc.wro4j:wro4j-maven-plugin:1.8.0:run failed: An API incompatibility was encountered while executing ro.isdc.wro4j:wro4j-maven-plugin:1.8.0:run: java.lang.ExceptionInInitializerError: null
Upon further research I found a Java version manager similar to nvm with node. I followed all of the steps I could find to download prior versions of Java hoping to find the one that worked. One issue arrived that caskroom and homebrew don't appear to host versions of Java older than Java11.
Is there something I am missing? I run these lines in my command line
brew tap caskroom/versions
brew search java
The only versions that show up after doing this are
java
java-beta
java11
java6
All of the instructions list versions 6-11 as available. Maybe they were removed? Maybe I'm doing something wrong? Any direction would be much appreciated.
I was unable to find a version of Java before 11 on homebrew other than Java6, but found this fix for anyone receiving the same error.
<plugin> section for wr04j in the pom.xml
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.18.0</version>
</dependency>
</dependencies>

Firebase Admin SDK: NoSuchMethodError for setCredential()

My application uses the Firebase Admin SDK for Java (recently upgraded from the Firebase Server SDK). It has worked correctly while testing on the local environment, however after deploying it to Google App Engine from Eclipse, the logs are showing this error:
com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backend method
java.lang.NoSuchMethodError: com.google.firebase.FirebaseOptions$Builder.setCredential(Lcom/google/firebase/auth/FirebaseCredential;)Lcom/google/firebase/FirebaseOptions$Builder;
Can anyone advise? I have checked pom.xml on the server and I can see that the firebase-admin SDK dependency was uploaded successfully:
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>5.2.0</version>
</dependency>
You may have to upgrade Firebase version to 4.1.0 or later. com.google.firebase.FirebaseOptions$Builder.setCredential() has been introduced since version 4.1.0.
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>4.1.0</version>
</dependency>
I had the same issue on Tomcat 8.0 on a dev machine (Windows 10).
I had just migrated firebase-admin from 4.1.7 version to the latest one (6.11.0), so there was somewhere an old firebase-admin-4.1.7.jar.
Hence that's what I did to fix:
find and delete any copy of firebase-admin-4.1.7.jar from my dev machine (check lib/ folders)
remove webapp from Tomcat Server
Maven Update
Project Clean

package javafx does not exist for sample "mavenproject" netbeans 7.4

I am trying to run the "mavenproject1" file created by doing a "File::new project" and selecting "maven" then "JavaFX Application".
I am using the latest and greatest. I have Java JDK 1.7.0_45 which I installed separately that is configured to build the project. I have Netbeans 7.4 (Build 201310111528) with MAVEN 3 built in. JavaFX is bundled with the JDK 1.7.0_45.
I can make the project execute, but my source files get an error indicating that the JavaFX package does not exist. I added the following to my pom.xlm file which allows Maven to build and execute the source files even though the NB editor cannot find the JavaFX packages:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>javafx</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${java.home}\lib\jfxrt.jar</systemPath>
</dependency>
How can I get the NB editor to recognize the JavaFX packages?
If you can, I advise using Java 8 as:
JavaFX is on the default Java classpath in Java 8 but not in Java 7.
As JavaFX is on the default Java 8 classpath, you don't need a system path dependency on jfxrt.jar in your maven project.
As JavaFX is on the default Java 8 classpath NetBeans 7.4 should recognize JavaFX packages with no extra configuration.
You may also want to consider using the javafx-maven-plugin.

Categories