Giter Club home page Giter Club logo

ng2-minimal'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.

ng2-minimal's People

Contributors

jhades avatar manwithacat avatar wcainboundary 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

Watchers

 avatar  avatar  avatar

ng2-minimal's Issues

not working while running npm start command - log attached

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: npm-run-all build-ts build-lib -p watch serve
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd C:\Users\Mahi\Desktop\angular2
12 error Windows_NT 6.3.9600
13 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
14 error node v4.4.4
15 error npm v2.15.1
16 error code ELIFECYCLE
17 error [email protected] start: npm-run-all build-ts build-lib -p watch serve
17 error Exit status 1
18 error Failed at the [email protected] start script 'npm-run-all build-ts build-lib -p watch serve '.
18 error This is most likely a problem with the ng2-minimal package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error npm-run-all build-ts build-lib -p watch serve
18 error You can get information on how to open an issue for this project with:
18 error npm bugs ng2-minimal
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls ng2-minimal
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

npm run server yields the following error

image

C:\Learning\angular-course-3-services-finished>npm run server

[email protected] server
node_modules/.bin/ts-node -P ./server.tsconfig.json ./server.ts

'node_modules' is not recognized as an internal or external command,
operable program or batch file.

Error running npm start: '.' is not recognized as an internal or external command

From the scripts section of package.json, this line looks suspect to me:
"serve": "./node_modules/.bin/http-server -c-1 ."

Here's the full output of "npm start":

'.' is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run-script" "watch"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] watch: ./node_modules/.bin/nodemon -V -w src --ext ".ts" --exec "npm run build-app"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script ' ./node_modules/.bin/node mon -V -w src --ext ".ts" --exec "npm run build-app"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-minimal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./node_modules/.bin/nodemon -V -w src --ext ".ts" --exec "npm run build-app"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-minimal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-minimal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users***\Source\GitHub\ng2-minimal\npm-debug.log
ERROR: watch: None-Zero Exit(1);

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: npm-run-all build-ts build-lib -p watch serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm-run-all build-ts build-lib -p watch serve '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-minimal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm-run-all build-ts build-lib -p watch serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-minimal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-minimal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users***\Source\GitHub\ng2-minimal\npm-debug.log

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.