Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError implementing WS-Security on Glassfish 4.1  RSS feed

 
Rob Micah
Ranch Hand
Posts: 107
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've created and successfully deployed a web service using NetBeans that implements WS-Security using "Username Authentication with Password Derived Key". The problem comes when I send a soap request to the service. Sending the same request twice I get 2 different errors. The first time I get this exception:




Changing nothing and resubmitting the same request again I get this exception:


 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The second is caused by the failure of the first.
The server attempts to initialise the SecurityRecipient class (by the look of it) and fails because Apache logging's LogFactory couldn't be found.

So that's your root cause.
 
Rob Micah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those exceptions don't happen on a single call. That happen on 2 separate requests. And even after adding the commons-logging.jar to the classpath those errors persist. After the application is deployed the first exception occurs and then every subsequent call causes the second exception.
 
Claude Moore
Ranch Hand
Posts: 862
8
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Dave pointed, try to fix the first issue. If even after adding Apache logging jars the first exception still occurs, it is likely that the class path is still misconfigured.
 
Rob Micah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something is definitely wrong with the classpath. I added the common-logging jar to the lib/ext directory of the domain and restarted the server but still no luck. What else am I missing?
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where exactly have you placed the jar file?

Is it in the WEB-INF/lib directory?

I'm assuming it's not a versioning issue, since I don't think the LogFactory has moved in several versions.
 
Rob Micah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Where exactly have you placed the jar file?

Is it in the WEB-INF/lib directory?

I'm assuming it's not a versioning issue, since I don't think the LogFactory has moved in several versions.


Dave, I actually did not place it inside the war file but in the glassfish install directory at /glassfish/domains/domain1/lib/ext.
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know Glassfish's structure, so can't really say where this should go if (and it's an if on my part) this is a glassfish thing and not something down to your project, in which case it should be part of your war.
 
Rob Micah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried packaging commons-logging.jar in the war at WEB-INF/lib but I get the same results.
 
Evgeny Udalov
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I faced the same problem.
The solution was found there: https://github.com/payara/Payara/issues/218/ ; -> "put commons-logging jar lib into dir C:\glassfish4\glassfish\modules, did fix this for me".
This helped me too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!