Thiago - Tech Director, Principal Architect and software developer for many different languages. I am passionate about the development of any kind. I am a developer since 1996, coding for many different styles such as Cold Fusion, Java, PHP, PL-SQL, Objective-C, Nodejs and many others..anything needed we can translate to code.
Saturday, October 1, 2016
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder on WindowsAuthProviderImpl class
Hey guys,
Recently I was working with JNA using Waffle to get the user details, and at same time creating a token on client side, in order to create a trust relationship between the targets.. Then i got this issue that I would like to share how to fix:
On top of JNA exists a library called Waffle which encapsulates all functionality you need to implement user authentication. Get from GitHub at https://github.com/dblock/waffle and also on Maven central. To download the jar files get from here: https://github.com/dblock/waffle/releases/download/Waffle-1.8.0/Waffle.1.8.zip
Using waffle project I got this error recently:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder
at waffle.windows.auth.impl.WindowsAuthProviderImpl.<init>(WindowsAuthProviderImpl.java:68)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.<init>(WindowsAuthProviderImpl.java:58)
at thiago.leoncio.Authenticator.main(Authenticator.java:19)
Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
To fix this you must add the library that has all google classes. It's name is guava-18.0.jar and of course the waffle one: waffle-jna-1.8.0.jar
Please, check this JNA and Waffle article also: http://phonecoding.com/2016/10/how-to-use-waffle-library-for-jna-java.html
I hope this helps,
Thiago Leoncio.
Saturday, September 17, 2016
How to setup Apache Invy dependencies in Eclipse
Hello everyone,
I am here today to share with you how to setup Apache InveDE and these great features that comes with with Ivy.
First of all I would like to explain you what are the benefits of using Apache Ivy on you projects:
Apache Ivy born from Apache Ant project. It born to resolve project dependencies and the time consuming to find what are the project dependencies every time you load it on a different place. In some way I would say that it competes with Apache Maven, but they differ on the distribution. Maven is a complete build tool, whereas Ivy is focused only on managing transitive dependencies. So, is some way I would say that the beauty of Ivy is that you can use the feature with any build process you already have in your company. So, Ivy has an external XML file that defines project dependencies as well as the list of resources necessary to build a project. Ivy then resolves it and downloads resources from an artifact repository. The last one can be either a private repository or one publicly available on the Internet.
Second of all I will provide you the steps to make it happen in Eclipse IDE, so let's rock it on!
First Step:
I am here today to share with you how to setup Apache InveDE and these great features that comes with with Ivy.
First of all I would like to explain you what are the benefits of using Apache Ivy on you projects:
Apache Ivy born from Apache Ant project. It born to resolve project dependencies and the time consuming to find what are the project dependencies every time you load it on a different place. In some way I would say that it competes with Apache Maven, but they differ on the distribution. Maven is a complete build tool, whereas Ivy is focused only on managing transitive dependencies. So, is some way I would say that the beauty of Ivy is that you can use the feature with any build process you already have in your company. So, Ivy has an external XML file that defines project dependencies as well as the list of resources necessary to build a project. Ivy then resolves it and downloads resources from an artifact repository. The last one can be either a private repository or one publicly available on the Internet.
Second of all I will provide you the steps to make it happen in Eclipse IDE, so let's rock it on!
First Step:
- Understanding that you already have your Eclipse installed then you can install Apache IvyDE plugins from IvyDE update site: http://www.apache.org/dist/ant/ivyde/updatesite
- On Eclipse: add the IvyDE update site. Following these steps (Note that for Eclipse 3.4 it may be different than what I am showing you today):
- Eclipse-Open the update manager tool: Help > Software Updates > Find and Install...
- On the popup window, select Search for features to install, and click Next
- Click on New Remote Site... to add new url.
- Name: the way you want, but I will suggets something related of Ivy to not forget it
- URL: http://www.apache.org/dist/ant/ivyde/updatesite
- Click OK
- A new entry "Ivy site update" will appear in the list of update sites
- Configuring the Ivy IDE plugin
- In order to move forward, please have created Ivy files in the eclipse project if you are setting up a new project or they are not included in the your project already.
- Add the libraries related of Ivy, running the add library feature, and the library called 'IvyDe Managed Dependencies'.
- Have configured the library to use the files created in step1.
- If you don't see the dependencies by any reason, you can always add it manually click on 'resolve dependencies' feature.
Once you are done with these steps above, you are ready to start coding and working with Ivy on your Eclipse new project. Please remember that you can use any build tool with Ivy libraries.
I hope it helps you, if so share with others. See you on next topic.
Thiago
Subscribe to:
Posts (Atom)





