I recently tried to add the google tink library to eclipse and it always has a "com.google.protobuf.GeneratedMessageV3$ cannot be resolved" error, I normally never have any problems with adding libraries to my project, and from what I can tell it has something to do with the all key template files since the error only occours when I try to generate a new KeysetHandle with any key template, and the error only starts when i enter in the key template file# https://github.com/Gameidite/testProject
The Protobuf library can generate Java classes for you. You need to find where these .class files have been output to (eg there should be a GeneratedMessageV3$.class somewhere) and make sure that they are included on your classpath. There's presumably somewhere in Eclipse where you can configure where it looks for class files - you'll need to add the generated files there.
If the generated class files don't exist yet you need to figure out what to do to generate them. It might be easier to use Maven or Gradle as suggested in the Tink documentation rather than directly adding things to Eclipse.
I think it's probably because Eclipse cannot find the protobuf Java runtime. Have you tried adding Tink to your project with Maven or Gradle?
Related
Ok I read too many Threads from many people who somewhat have a similar problem but none of them solved my problem so please assist me with my huge "pain in the ass"-problem which I seem to not fully understand.
I'm trying to use the MediaPlayer Class from javafx.scene.media and sadly the media class isn't inherited in the default SDK's since Java 9 I think and I'm using Java Version 12. So naturally I have to add the jafafx.scene.media library (jar-Format) manually which should be the easiest step in the world.
I am able to add it via "Project Structure -> Libraries -> Add Library" and it shows up in my external library menu but none of my classes can import it.
That's my first Java project (I come from C#) and I even asked my proffessor but he didn't have a clue either. I even tried to create a new project and add it but with no success.
(I tried adding the library via Maven-Dependency, too, with no success)
Then I thought that another library could work and I added vlcj (VLC-Player) and at least it does find something to import after going to "Project Structure -> Modules -> Dependencies" and changing the vlcj library from compile to Provided.
But now when importing I get the following error:
Error
I am so confused. And it's even for a school project.
Please give me advice if you have any or tell me if I need to drop more infos.
Much Love
Kong
Adding a library is not enough, the library must be also in the module dependencies.
Also, if you are using Java 9+ module system, you have to adjust your module-info.java file for that. Or just delete this file and don't use Java modules for this project for the sake of simplicity.
When I try to compile my project, I get a org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.CTArray not found-error. I've read that this has something to do with the openxml jar.
I'm using Apache POI, I've downloaded POI-4.1.0.rar and added this to my Netbeans libraries. This rar contains a poi-ooxml-schemas.jar, which I assume is causing the error. However I'm not sure if this is what causing the error, or if I'm missing a jar.
This is an overview of the libraries in my project.
I was having same exact exception you described. I followed this advise: https://stackoverflow.com/a/38262782/4101334
Second part of Finbarr O'B response has fix description.
This part also important: "Be sure to remove the poi-ooxml-schemas dependency from your maven pom.xml so that ooxml-schemas above takes precedence instead."
I'm using Netbeans IDE 8.2, trying to build a "legacy application" after some updates.
The compile is finishing ok, but then NetBeans is packaging up stuff in dist/, and encounters some missing library issues:
Copying 1 file to /path/to/Project/build
Not copying library /path/to/Project/${libs.log4j.classpath} , it can't be read.
Not copying library /path/to/Project/${libs.ApacheCommonsCLI.classpath} , it can't be read.
Not copying library /path/to/Project/${libs.BoneCP.classpath} , it can't be read.
It refused to copy some other libraries, but these had exact path in the error messages, so I could just put the .JARs where it wanted them. I have already added some JARs to the source-tree under "Libraries", and this helped the compile succeed. But it doesn't seem to use these for this operation.
How do I provide NetBeans these files? Where does ${libs... refer to?
EDIT: I found that text in a subfolder/project.properties:
libs.ApacheCommonsNet.classpath=../Apache/Commons/commons-net-1.4.1/commons-net-1.4.1.jar
...
javac.classpath=\
${libs.ApacheCommonsNet.classpath}:\
${libs.log4j.classpath}:\
${libs.ApacheCommonsCLI.classpath}:\
${libs.MySQLDriver.classpath}:\
${libs.BoneCP.classpath}:\
...
So it's not complaining about ApacheCommonsNet because there is a hard-coded path further up in the properties. Maybe I can add one for each missing library.
The problem is resolved by configuring NetBeans Libraries under [Tools]->[Libraries].
To resolve say the ${libs.ApacheCommonsCLI.classpath} dependency, I added a library named "ApacheCommonsCLI", then for that entry added the JAR "commons-cli-1.2.jar" via the button [Add JAR/Folder...].
The dependency starting with the test ${libs. is an indicator that it is looking for it here.
I am trying to use messagepack to send data back and forth between an Arduino and a Java application, and I am having trouble setting up the java implementation of messagepack: msgpack-java (https://github.com/msgpack/msgpack-java/wiki/QuickStart).
I wanted to avoid building the entire library myself, so I used v0.6.8 from here.
The sample code compiles successfully but at runtime I get
java.lang.NoClassDefFoundError: javassist/ClassPath
specifically at the line
MessagePack msgpack = new MessagePack();
I tried just building the msgpack jar myself, but I got compile errors on the source code because it is missing javassist packages. I do not know where to get the correct packages, and unfortunately the developers don't mention that in the documentation. I couldn't find a comments section on their page so I was hoping that someone on here could help me get msgpack working.
I also looked at this question (Using MessagePack with Android) but it was not really clear about where I can get the libraries I need.
I guess this was a fairly obvious question but I'll answer it here in case anybody else is having troubles like me. I ended up learning about the dependencies I needed by looking at the Maven POM file. This file told me that I needed the json-simple library and the javassist library. I just downloaded the .jar files for these two libraries and added them to the eclipse build path and everything ran just fine.
As an alternative, consider sirbrialliance's stripped-down static implementation: https://bitbucket.org/sirbrialliance/msgpack-java-lite
This is a bit better documented and easier to set-up initially.
I'm trying to generate some stubs for a WSDL (using xmlbeans) and keep running into some issues. I'm using the following page:
http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients-xmlbeans.html
The only part of these steps that I'm skipping is the "client.java" part because I already have another project ready I want to plug the resulting jars into. A quick run down of my steps are as follows:
My WSDL is a crmonline instance, so I run something like this:
C:\Work\aaa2>WSDL2Java -uri
https://mycrmorgname.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl
-p crmsdk -d xmlbeans -s -o c:\mystubfolder
I build the project using "ant"
In my "client" project I reference the 2 jars created in .\build\lib
My project builds fine once I add all my axis2 / apache references etc, but when I launch it through playframework I get errors when I hit the first page. The first error seems to be:
17:48:45,289 ERROR ~ Error in ControllersEnhancer.
controllers.ProfileController.editProfile has not been properly enhanced
(fieldAccess javassist.expr.FieldAccess#212ca458).
or something similar to that. Scrolling down through the error I can see that I'm getting this:
The file /app/models/MyDynamicsClient.java could not be compiled.
Error raised is : org.apache.axiom.om.util.AXIOMUtil cannot be resolved
Now, I haven't even hit any of my web services yet, or even instantiated any of my classes ... I'm at a loss as to why this is happening. Or to be more accurate, what exactly am I messing up! Am I missing a reference to something? Doing a search on AXIOMUtil tells me this should be in Axiom-api (version I have is Axiom-api-1.2.10.jar). I have this referenced and doesn't seem to help. Or maybe I'm doing something else wrong someplace?
Some details on versions:
Axis2 1.5.4
Apache-ant 1.8.3
Any help would be very much appreciated!!
Ok, after trying a lot of different things and rereading the sites/instructions I realised what I was doing wrong. Or at least I figured out a couple of things that I started to do differently that fixed the problem.
Firstly, I was using jar files from another sample project for the apache http components. I don't know if this had an impact, but I downloaded a fresh version of this anyway and referenced those JARS instead.
Also, instead of creating jars in my "stub" project and referencing those I copied all the generated stubs/classes directly into the existing client project. I have a feeling this might have been what fixed my problem. Or maybe a mix of this and the previous step I did!
So my new steps are as follows:
Ensure you have all the correct versions downloaded for required components. In my case I have the following:
Apache Axis 2 v 1.5.4
Apache HTTP components client 4.1.3
Apache-ant 1.8.3
Copy all the JARS from the Axis2 and HTTP Components libs into your client project and reference them.
Use WSDL2Java to create your stubs and classes within it's own project.
Ensure the project builds using Ant
Copy all the generated class files within the src folder into the source folder of your client.
Fix any other reference isssues and Build
Thankfully this got me going.