This discussion is archived
11 Replies Latest reply: Apr 25, 2011 9:46 AM by 796440 RSS

java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(

831063 Newbie
Currently Being Moderated
Hi,

I'm seeing the following erroe when I run my test which will internall calls external service via synchronous webservice call.

It works in my local but when i run it in my IT( test environment) it is giving following error.


[junit] ERROR bindExceptionToResponse, WSWS3400I: Info: unexpected exception.
[junit] java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(IF)V
[junit] at com.ibm.ws.webservices.engine.transport.OneWayConnectionMap.<init>(OneWayConnectionMap.java:49)
[junit] at com.ibm.ws.webservices.engine.transport.OneWayConnectionMap.getInstance(OneWayConnectionMap.java:60)
[junit] at com.ibm.ws.webservices.engine.transport.channel.OutboundConnectionCache.<init>(OutboundConnectionCache.java:224)
[junit] at com.ibm.ws.webservices.engine.transport.channel.OutboundConnectionCache.getInstance(OutboundConnectionCache.java:253)
[junit] at com.ibm.ws.webservices.engine.transport.http.HTTPSender$1.run(HTTPSender.java:237)
[junit] at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
[junit] at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:234)
[junit] at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:249)
[junit] at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:249)
[junit] at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:249)
[junit] at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
[junit] at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:937)
[junit] at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:731)
[junit] at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:680)
[junit] at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:502)
[junit] at com.ibm.ws.webservices.engine.client.Stub$Invoke.invoke(Stub.java:1007)
[junit] at com.eig.services.policy.AIP215AIHTTPSoapBindingStub.AIP215AIOperation(AIP215AIHTTPSoapBindingStub.java:397)
[junit] at com.eig.cis.policy.PolicySearchServiceWrapper.callPMSPolicySearch(PolicySearchServiceWrapper.java:66)
[junit] at com.eig.cac.unittest.ejb.PolicySearchServiceWrapperTest.shouldCallPMSPolicySearch(Unknown Source)


Any idea what's going on?
  • 1. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    gimbal2 Guru
    Currently Being Moderated
    On the test server run java -version. What do you get?

    edit: And why are you posting this in monitoring & troubleshooting I wonder?
  • 2. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    831063 Newbie
    Currently Being Moderated
    It says java version 1.6..


    any suggestions that where I have to post this?
  • 3. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    802316 Pro
    Currently Being Moderated
    This constructor was added in Java 6. I would check you have the latest version of Java 6

    Can you log System.getProperty("java.version") before this happens?
  • 4. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    831063 Newbie
    Currently Being Moderated
    Thanks Peter..
    I will do it and let you know..This z really helpful...
  • 5. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    831063 Newbie
    Currently Being Moderated
    It says the Version is '1.5.0'


    so do you want me to update it to 1.6?
  • 6. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    796440 Guru
    Currently Being Moderated
    user5447944 wrote:
    It says the Version is '1.5.0'


    so do you want me to update it to 1.6?
    I doubt he cares whether you update it. However, if you read what he wrote, you'll see that the constructor it's complaining about was added in 1.6, and if you do a bit of math, you'll find that the version that you're running, 1.5, is older than 1.6, and if you apply a teeny tiny bit of logic to that, you'll see that this means that the version that you're running doesn't have the constructor you're trying to use, and if you apply a teeny tiny bit more logic, you'll realize that, regardless of what Peter wants or doesn't want, your only choices are a) upgrade to 1.6, b) don't use that constructor, or c) just live with it not working.

    The thing is, if your code compiled, you must have compiled it with 1.6, so even if you stop using that c'tor, it cannot work in a 1.5 environment anyway, unless you set the "target" flag to 1.5 when you compiled, but even then, you might still run into occasional problems like this.
  • 7. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    jtahlborn Expert
    Currently Being Moderated
    jverd wrote:
    user5447944 wrote:
    It says the Version is '1.5.0'


    so do you want me to update it to 1.6?
    I doubt he cares whether you update it. However, if you read what he wrote, you'll see that the constructor it's complaining about was added in 1.6, and if you do a bit of math, you'll find that the version that you're running, 1.5, is older than 1.6, and if you apply a teeny tiny bit of logic to that, you'll see that this means that the version that you're running doesn't have the constructor you're trying to use, and if you apply a teeny tiny bit more logic, you'll realize that, regardless of what Peter wants or doesn't want, your only choices are a) upgrade to 1.6, b) don't use that constructor, or c) just live with it not working.

    The thing is, if your code compiled, you must have compiled it with 1.6, so even if you stop using that c'tor, it cannot work in a 1.5 environment anyway, unless you set the "target" flag to 1.5 when you compiled, but even then, you might still run into occasional problems like this.
    minor point, it looks like the code calling the missing constructor comes from a third-party library "com.ibm.ws.webservices", so the problem comes from a dependency compiling using 1.6.
  • 8. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    gimbal2 Guru
    Currently Being Moderated
    It says java version 1.6..
    It says the Version is '1.5.0'
    Gee, this version of Java cannot make up its mind apparently.
  • 9. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    796440 Guru
    Currently Being Moderated
    jtahlborn wrote:
    jverd wrote:
    user5447944 wrote:
    It says the Version is '1.5.0'


    so do you want me to update it to 1.6?
    I doubt he cares whether you update it. However, if you read what he wrote, you'll see that the constructor it's complaining about was added in 1.6, and if you do a bit of math, you'll find that the version that you're running, 1.5, is older than 1.6, and if you apply a teeny tiny bit of logic to that, you'll see that this means that the version that you're running doesn't have the constructor you're trying to use, and if you apply a teeny tiny bit more logic, you'll realize that, regardless of what Peter wants or doesn't want, your only choices are a) upgrade to 1.6, b) don't use that constructor, or c) just live with it not working.

    The thing is, if your code compiled, you must have compiled it with 1.6, so even if you stop using that c'tor, it cannot work in a 1.5 environment anyway, unless you set the "target" flag to 1.5 when you compiled, but even then, you might still run into occasional problems like this.
    minor point, it looks like the code calling the missing constructor comes from a third-party library "com.ibm.ws.webservices", so the problem comes from a dependency compiling using 1.6.
    Right. Guess I should have said, "... --you-- +somebody+ must have compiled it with 1.6..." I didn't read the stack trace closely, but I kind of figured the OP would come back with, "But it's not my code," leading us back to choice a) upgrade.
  • 10. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    831063 Newbie
    Currently Being Moderated
    Thanks for the response but it is working for my application when I start the server but not working for Junit.

    any ideas around....?
  • 11. Re: java.lang.NoSuchMethodError: java/util/concurrent/ConcurrentHashMap.<init>(
    796440 Guru
    Currently Being Moderated
    user5447944 wrote:
    Thanks for the response but it is working for my application when I start the server but not working for Junit.

    any ideas around....?
    That doesn't change anything. What's been said so far was not qualified with "...except when using JUnit," or "...only on a server." So the only, possible conclusions are that either you're running your application or server or whatever with the appropriate version of java, but running JUnit with an older version of Java, and therefore need to point JUnit at an appropriate version, or JUnit is exercising code that so far your server/application isn't--so far.

    Edited by: jverd on Apr 25, 2011 9:46 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points