Fixing "ExtLibUtil cannot be resolved" issue - java

I have been working on trying to use the openLogger tool which uses the OpenLog Database also available at openNTF, and I have hit a bit of a snag. My question is not about those databases explicitly, they are just a good example of what is going wrong!
My issue is that I wanted to rebuild the OpenLogger Demo/test database after making a few changes to the xsp.properties file, and I suddenly was presented the wonderful gift of 12 or more errors, all of which were that the com.ibm.xsp.extlib.util.ExtLibUtil class could not be resolved.
After a bit of googling, I found out that it sometimes helps to re-install Designer - done (three times)or to re-install the ExtLibs (done a few times and then upgraded to the 900_201305* version)
nothing.
I have really tried everything I can think of, and everything that I could find via google, but I cannot figure out how to get this thing to resolve. I remember once upon a time having to copy specific jar files into the designer install directory, but I cannot remember the details, nor can I find anything about that, nor do I know if this is my issue. I also thought about a specific designer variable not being set that would tell designer where to find the jar files, but I would not know where to begin searching for that.
Any help getting this thing to resolve would be a HUGE! help. It could also be that I wish to use this awesome looking class in my own applications. Thanks!

To make sure that the jar files is found and able to be used, try these things:
Use the package explorer to make sure the jar is in the "Referenced Libraries" folder
Check the build path, and add the jar to the build path if necessary
Examine the XSP properties file and make sure it looks correct, and then change something and resave it
Use Project | Clean which sometimes fixes issues like this

Related

Multiple dex files error when building project downloaded from git

So I have a project that works totally fine in one workspace on my machine. I push it to the repository so everyone else can work on it. I go to pull it down making sure all the changes are good. I import the project into a new workspace and using eclipse with autobuild on it produces no errors.
I go to the command line and run ant clean release on the project and right before it gets to run crunch on the assets the build fails with a mulitple dex files define error. Ive checked the project high and low and compared to the other copy of it in the original workspace but for what ever reason I cant get it to build. I erase the bin and gen folders and remove all the imports and basically leave just the project, run clean in eclipse, and still get a dex define error related to one of the lib projects classes. Ive tried to find where extra copies could be but I dont find anything.
googling around for the past few days hasnt helped as the normal solutions to such a problem havent worked for me. So what is the best way to figure out where the extra class definitions are coming from so I can get rid of them and fix the repository so I can use it correctly. I have a feeling its related to one of the files in the project that I should be excluding in my gitignore but Im not sure which that would be. Any help on the matter would be greatly appreciated cause this has eaten quite a bit of time of just messing around.
When you have more than one class with the same package name this error would raise.
One of the common source of this issue is when you have for example different version on the same library.
For example your add ActionbarSherlock which in 'libs forder has it's own support library and also your project has another version of support library in it's libs folder. In such a cases you should put one version of support library.jar to all different libraries that you using it.
I hope this could help you.
I didnt find the root of the problem but I figured out a fix. I moved all the support libraries to a new root folder completely away from the android project. Once I did that and cleaned everything I then ran ant clean release and the project built fine.

Problems getting Jar file to link correctly. Verify Errors

I've been searching the web for a long time, and it seams that this VerifyError isn't that uncommon and can have multiple reasons for tripping. I have created a project, that I've exported as a jar file. It is built with android 2.2 (API 8). This part works fine. But I have a separate project that when I try to import it, I start having problems.
The only way I've been able to get it to work, is to import the jar into a libs folder I created. It then get's automatically added as an Android Dependency and I can use it fine, however I can't attach my javadoc file to it, and in my build configuration it says I can't modify the dependency. (Can't link to a javadoc).
What I thought I should be able to do is simply add it as an external jar, then link the javadoc and source. If I do this, the code that uses the jar shows no errors, and the javadoc comments work. However I keep getting a VerifyError when I run it. I've attached a stack trace that shows the errors. I'm completely out of ideas, does anyone have any suggestions? Am I building the jar file wrong? Am I importing it wrong?
If anyone can help point me in a constructive direction, it would be really appreciated.
Thanks
Stack trace:
Ok, so this was frustrating to solve. The solution took about 20 seconds when I spent over an hour researching the problem.
What I had to do was go to:
Properties -> Java Build Path -> Order and Export
But rather than just clicking the external jar, I had to move it up to the top of the list for the build path order.
Credit definitely goes to yorkw for pointing me in the right direction.
I believe that Android jar files are a little different.
You could try putting the JAR files into the Android "dx" tool
It's in the ~/android-sdk/platform-tools

import wavemaker statement cannot be resolved

I am taking over code someone else wrote and am having to find everything they used for this project manually because they didn't send everything that was needed. (One of those out of the country contract work deals.) Anyway, I'm having trouble finding something. They imported com.wavemaker.runtime.data, com.wavemaker.runtime.services and com.wavemaker.json.type and I can't figure out how to get these unresolved errors to go away. I've moved WaveMaker into the same folder as my project and I've searched high and low for a .jar file on my machine and on the internet to no avail. Please help?? (FYI I'm using Eclipse & Java)
This is easy, you have to add the jars to the eclipse configuration path (i.e: ~/WaveMaker/projects/wm_example_project/lib), when you find it, make sure that you add all those libs to your build path.

Java: Missing libraries

I'm a bit new to Java / Processing and I opened up a project/workspace with the following errors:
is missing required library: '/Applications/Processing.app/Contents/Resources/Java/libraries/javamail/smtp.jar'
/javamail/dsn.jar
/javamail/mailapi.jar
/javamail/pop3.jar
I have the Processing app installed, but it's been a while...do I just need to upgrade processing or is there another place I need to go to get these .jar files?
I'm using Eclipse and there seems to be quite a list of referenced jar files (some broken)
It's telling you that there used to be a library at
/Applications/Processing.app/Contents/Resources/Java/libraries/javamail/smtp.jar
but it's no longer there, or possibly you opened a project that somebody else edited on a different machine where things were laid out differently.
Open the project build-path dialog and make sure all the libraries point to the correct locations.
If the problem still persist, try doing clean and build in eclipse. It might help.

"Uncompilable source code" RuntimeException in netbeans

I'm trying to help another developer who is using Netbeans. When he runs or debugs some code of his in Netbeans (6.9.1) he gets an "Uncompilable source code" RuntimeException. I'm pretty experienced in Java but am more used to IntelliJ, and haven't used Netbeans at all.
I've done it a bit of googling and it seems Netbeans will compile code even with errors, and then throw the RuntimeException at the errors. (Fairly bad behaviour IMO, but I guess some will find it useful.) I've got him to completely rebuild the project with no compile errors, but the RuntimeException seems to still occur. I assume he's got some bad cached class data somewhere deep within Netbeans.
2 questions:
What is the best way to clear the cache so we can find out where the uncompilable code is?
Is there any way of turning off this behaviour so the code won't run/debug unless everything will compile, so these RuntimeException's won't be injected into the code?
I've googled a fair bit, but haven't found the answer to either of these questions yet.
Update: More information:
Turning off the "compile on save" option makes the problem go away. Turning CoS back on again brings the exception back. Unfortunately this isn't a fix, as CoS is a very useful option.
http://netbeans.org/bugzilla/show_bug.cgi?id=182009 seems the closest bug report, but it has been closed as "RESOLVED INCOMPLETE". Unfortunately the bug is hard to reproduce - the exception is happening in Java library code, when it calls a third-party library, so there isn't anything at the point the exception is thrown we can change. And the code will work for weeks, and then suddenly start throwing this error with no obvious reason why.
We've tried manually deleting the entire build directory - still not a fix.
We finally got a solution, but still don't quite know why the situation occurs. When you have Compile On Save activated, Netbeans generates a second set of class files for debugging etc. These are stored in $USER/.netbeans/var/cache/index/s*/java/*/classes
Somehow (not sure how) this directory can get corrupted or fail to update.
If you close netbeans, delete $USER/.netbeans/var/cache/index and all subdirectories and restart netbeans this clears the cache. If you have no compile errors, your problem ought to go away at this point.
NB: $USER is your user directory - on Windows 7 this is usually c:\Users\username, I guess on Unix it will be ~username.
If you get this problem please vote for, comment on, or add information to: http://netbeans.org/bugzilla/show_bug.cgi?id=182009
I experienced the same wired problem in NB 7.0.1, my hammer-IQ solution was to make a typo in the source code, run NB with this error (despite an error message) and than the cached class was successfully deleted.
I experienced this issue on Linux Mint Nadia with Netbeans 7.2.1, but was stumped as to where the cache location might be - mine was actually located at
/home/USER/.cache/netbeans/7.2.1
rather than in the .netbeans folder.
If you're not sure where the cache is located on your particular setup, just go to the help > about menu in Netbeans and it'll tell you the correct path.
After realising that the cause was a bad cache from the other posted solutions, I solved this problem by copying the file to another directory, deleting it from NetBeans, and then adding it again.
In fact, you neednt delete whole of index folder.
When you open netbeans and your project folder is active. Netbeans starts scanning files and creates temporary project folders (in index folder) for all active projects. If you check index\segments file(its a text file and can be viewed in notepad/(text editor)), you will be able to identify the folders that represent your project. You can then delete those folders and restart netbeans.
*Active project means those projects that were open before Netbeans was shutdown.
Had the same problem on Windows 7 with Netbeans 12.
Cache is here:
C:\Users\<Username>\AppData\Local\NetBeans\Cache
, but the deleting cache is not helpful sometimes. The better solution is to recompile the problematic class i.e. make a minor change (e.g. add space) and save.

Categories

Resources