"Hook previously registered" Problem

293 views
Skip to first unread message

Ran

unread,
May 13, 2015, 5:17:05 AM5/13/15
to ldsp...@googlegroups.com
Hi, all

I called ldspider from another class, when it finished and run second time I got the following exception. Seems some file/ thread didn't close preperly, but I can't find it. Have anyone run into that? 

java.lang.IllegalArgumentException: Hook previously registered
        at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:72)
        at java.lang.Runtime.addShutdownHook(Runtime.java:211)
        at com.ontologycentral.ldspider.ldspiderMain.run(ldspiderMain.java:681)
        at com.ontologycentral.ldspider.ldspiderMain.ldspiderMain(ldspiderMain.java:373)
        at main.java.focusedCrawler.focusedCrawlerMain.runPlainBFCrawl(focusedCrawlerMain.java:93)
        at main.java.focusedCrawler.focusedCrawlerMain.focusedCrawlerMain(focusedCrawlerMain.java:60)
        at crawl_api.RestAnnotate.crawl_data(RestAnnotate.java:56)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)

Andreas Harth

unread,
May 15, 2015, 7:00:57 AM5/15/15
to ldsp...@googlegroups.com
Hi Ran,

do you try to re-use the objects? Could you do "new" when you use the
objects a second time? Or do you need to keep state (e.g., the set of
visited URIs) between the two runs?

Cheers,
Andreas.
> --
> You received this message because you are subscribed to the Google
> Groups "LDSpider" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ldspider+u...@googlegroups.com
> <mailto:ldspider+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages