Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

NoClassDefFoundError implementing WS-Security on Glassfish 4.1

 
Ranch Hand
Posts: 108
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:


 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1318
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried packaging commons-logging.jar in the war at WEB-INF/lib but I get the same results.
 
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic