Menu

NoClassFoun

Kaii
2015-07-14
2016-03-04
  • Kaii

    Kaii - 2015-07-14

    I am getting this exception when making an HTTPs call. It happens infrequently, presumably due to a time-out?

    Exception in thread "Keep-Alive-Timer" java.lang.NoSuchMethodError: org.silvertunnel_ng.netlib.adapter.url.impl.net.http.KeepAliveCache.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
    at org.silvertunnel_ng.netlib.adapter.url.impl.net.http.KeepAliveCache.run(KeepAliveCache.java:237)
    at java.lang.Thread.run(Thread.java:745)

    Here is the snippet of the code I am running:

                 URL url = new URL( context, urlStr, handler );
    
                HttpURLConnection urlConnection = ( HttpURLConnection ) url.openConnection();
                urlConnection.setConnectTimeout( 15000 );
    
                urlConnection.connect();
                int responseCode = urlConnection.getResponseCode();
                if ( responseCode != 200 ) {
    
                    return;
    
                }
    
                is = urlConnection.getInputStream();
    
                BufferedReader in = new BufferedReader(new InputStreamReader( is ));
                StringBuilder htmlSb =  new StringBuilder(  );
                String inputLine;
    
                while ((inputLine = in.readLine()) != null) {
    
                    htmlSb.append( inputLine ).append("\n");
                }
    
                in.close();
    
                content = htmlSb.toString();
    
     
  • Tobias Boese

    Tobias Boese - 2015-07-20

    Hi Kali,

    sorry for the late reply.

    What JDK/JRE are you using?

    this method should be provided by the Java-implementation.

    regards Tobi

     
  • Kaii

    Kaii - 2015-07-26

    java -version
    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b40)
    Java HotSpot(TM) 64-Bit Server VM (build 24.0-b55, mixed mode)

     
  • Vinit Parakh

    Vinit Parakh - 2015-08-26

    Hello Tobias,

    Firstly thanks for creating the awesome library. However, I am getting the same error as above and from what I understand there is some problem with the code. @Kaii where you able to fix this? Please let me know!

    Thanks,
    Vinit

     
    • Kaii

      Kaii - 2015-08-28

      I realized that we need Java 1.8 , not 1.7. I haven't upgraded to 1.8 but have verified that it makes the problem go away. I just ignore the error and haven't seen any obvious problems (other than the error message)

       
  • Tobias Boese

    Tobias Boese - 2015-09-21

    Hi,
    sorry for the late reply. I think I've found the problem. I fixed the code to use an Iterator instead of a foreach and now it should work flawlessly ;)

    You can download the new SNAPSHOT Version 0.0.5 from SF or Maven.

    regards Tobi

     
  • Vinit Parakh

    Vinit Parakh - 2016-03-04

    Hi,

    I tried using SNAPSHOT Version 0.0.5 from SF, but I am getting the following error :
    java.lang.NoClassDefFoundError: org/spongycastle/jce/provider/BouncyCastleProvider

    I have bouncycastle:bcprov-jdk14:132 in my buildpath. Is there any other dependency that I am missing?

    Thanks,
    Vinit

     
    • Vinit Parakh

      Vinit Parakh - 2016-03-04

      I was able to resolve the above issue. But when I am using SNAPSHOT Version 0.0.5 from SF, I am getting the following error :

      16/03/04 09:41:07 WARN directory.Directory: error while parsing the router descriptors in parallel
      java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class org.silvertunnel_ng.netlib.layer.tor.common.LookupServiceUtil
      at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      at java.util.concurrent.FutureTask.get(FutureTask.java:188)
      at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.parseRouterDescriptors(Directory.java:523)
      at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.fetchDescriptors(Directory.java:627)
      at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.updateRouterList(Directory.java:382)
      at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.updateNetworkStatusNew(Directory.java:460)
      at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.refreshListOfServers(Directory.java:317)
      at org.silvertunnel_ng.netlib.layer.tor.directory.DirectoryManagerThread.updateDirectory(DirectoryManagerThread.java:67)
      at org.silvertunnel_ng.netlib.layer.tor.directory.DirectoryManagerThread.run(DirectoryManagerThread.java:80)
      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.silvertunnel_ng.netlib.layer.tor.common.LookupServiceUtil
      at org.silvertunnel_ng.netlib.layer.tor.directory.RouterImpl.<init>(RouterImpl.java:193)
      at org.silvertunnel_ng.netlib.layer.tor.directory.RouterParserCallable.call(RouterParserCallable.java:55)
      at org.silvertunnel_ng.netlib.layer.tor.directory.RouterParserCallable.call(RouterParserCallable.java:33)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

      It just hangs after this and does not make a connection. The same code was working fine with Version 0.0.3. However now with 0.0.3 as well I am getting the same error. Could you please tell me what might be wrong?
      
      Thanks,
      Vinit
      
       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.