GithubHelp home page GithubHelp logo

angularjs-gulp-example's Introduction

JHades - Your way out of Jar Hell!

JHades is a Java classpath troubleshooting tool. It helps to solve common Java classpath / Jar Hell related problems such as ClassNotFoundException, NoClassDefFoundError, ClassCastException, NoSuchMethodException, LinkageError, etc.

It allows to query the classpath for class duplicates, find specific resource locations, etc.

Documentation available at http://jhades.github.io

Example of a classpath problem

Let's say a java web application works fine in development, but when deploying it to a server the following problem occurs:


java.lang.ClassCastException: org.apache.bval.jsr303.ApacheValidationProvider cannot be cast to javax.validation.spi.ValidationProvider
	javax.validation.Validation$DefaultValidationProviderResolver.getValidationProviders(Validation.java:332)
	javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:256)
	javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
	classloaders.test.TestServlet.doGet(TestServlet.java:33)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:91)

How to troubleshoot

JHades provides several commands that allow to extract from the runtime environment a lot of information which is important for understanding what is going on. Namelly these types of questions can be answered:

  • are there any overlapping jars, with different versions of the same class?
  • Are those multiple versions of the same class all identical or not ?
  • where are the different versions of a given class located ?
  • which class loader is loading which version of a given class ?
  • What does the chain of classloaders look like, how are the classloaders configured ?

This is an example of how to answer several of these questions for the sample problem above:

 
 new JHades()
	.printClassLoaders()
	.printClasspath()
	.overlappingJarsReport()
	.multipleClassVersionsReport()
	.findClassByName("org.apache.bval.jsr303.ApacheValidationProvider")
	.findClassByName("javax.validation.spi.ValidationProvider"); 
	

Jar overlap report

One of the most common sources of classpath problems are overlapping jar files, that contain multiple versions of the same class:


>>>> Jar overlap report: 
 
aspectjrt-1.7.2.jar overlaps with aspectjweaver-1.7.2.jar - total overlapping classes: 129
ejb3-persistence-1.0.2.GA.jar overlaps with hibernate-jpa-2.0-api-1.0.1.Final.jar - total overlapping classes: 91
stax-api-1.0-2.jar overlaps with xml-apis-1.4.01.jar - total overlapping classes: 34
javax.xml.soap-api-1.3.5.jar overlaps with saaj-api-1.3.jar - total overlapping classes: 29
commons-beanutils-1.8.3.jar overlaps with commons-collections-3.2.1.jar - total overlapping classes: 10
xbean-2.2.0.jar overlaps with xml-apis-1.4.01.jar - total overlapping classes: 6
commons-logging-1.1.1.jar overlaps with jcl-over-slf4j-1.6.6.jar - total overlapping classes: 6
 
Total number of classes with more than one version: 305

Check http://jhades.github.io for more details.

angularjs-gulp-example's People

Contributors

jhades avatar sebeichholz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angularjs-gulp-example's Issues

followed the instructions in read me file but got error

followed the instructions in read me file but got error on running "gulp"

.../work/samples/angular1_seed/angularjs-gulp-example/node_modules/socket.io/lib/store.js:35
Store.prototype.proto = EventEmitter.prototype;
^

TypeError: Cannot read property 'prototype' of undefined
at Object. (/Users/saurabh/work/samples/angular1_seed/angularjs-gulp-example/node_modules/socket.io/lib/store.js:35:41)
at Module._compile (module.js:571:32)

extra steps under osx

I don't know enough about the build chain to fix myself (if I have time I'll figure it out).
npm install -g gulp
npm install gulp-sass
npm install node-sass

Otherwise you get:
Gulp not found
And then
throw new Error('libsass bindings not found. Try reinstalling node-sass?');

Warnings when run with node 0.12.0

FYI. Ran into warnings during npm install. It might be just a version thing with karma, and pngjs. That seems pretty easy.

I'm not sure about node-gyp that is calling customFds vs. stdio.

npm WARN engine [email protected]: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.0","npm":"2.5.1"})

> [email protected] install /Users/bbonner/Documents/indigo/angularjs-gulp-todo/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
  SOLINK_MODULE(target) Release/.node
  SOLINK_MODULE(target) Release/.node: Finished
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  SOLINK_MODULE(target) Release/fse.node: Finished

> [email protected] install /Users/bbonner/Documents/indigo/angularjs-gulp-todo/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-macosx.zip
Saving to /var/folders/36/l9drm8hd3gvcbvlblxyt54dr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
Receiving...
  [=======================================-] 98% 0.0s
Received 9187K total.
Extracting zip contents

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.