[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Guide to user other DBMS



This would be about the "haveNA" and "setHaveNA" methods.  Probably if you generate some logging output when they are called, you will be able to see what is going wrong.

Robert

On Nov 25, 2016, at 10:11 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:

I did it. I mean, in the file there was already the "auto_homed_prefixes" section inside server_config block.

I just check it but this is not the error (actually, hdl-dbtool works fine).

Any other idea?some parameter I forgot to change in the class that extends from HandleStorage or something?.

Thanks.

De: Robert R Tupelo-Schneck <schneck@cnri.reston.va.us>
Enviado: viernes, 25 de noviembre de 2016 2:22:55
Para: Ruiz-Zafra, Angel
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] Guide to user other DBMS
 
You have to "home the prefix".  This is done by sending a special request to the server, which tells the server to consider itself responsible for the prefix.

Easiest way to do this is to add to your config.dct "server_config":

"auto_homed_prefixes" = ( "0.NA/55555" )

Robert

On Nov 24, 2016, at 5:41 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:

Works fine now, or at least connect ok.

Was the server address in the config file as well as the credentials to authentaticate.

I can manage handles with dbtool (list, create and modify handle) and check the result in the mongo database, however using the same java source code that I have been using now I get this error: SERVER NOT RESPONSIBLE FOR HANDLE: That prefix doesn't live here.

As I said is to strange, because dbtool works fine..should I change something in the source code? For example, to get a handle;

public HandleValue[] getFullHandle(String hid){
     try { 
       return new HandleResolver().resolveHandle(local_prefix+"/"+hid, null, null);                        }catch(Exception e){ 
       System.out.println("ERROR:"+e.getMessage()); 
  } 
  return null; 
}

THe local prefix is 55555. I try with 55555/, adding 0.NA/55555..but still get the same error (prefix doesn't live here).

Any suggestion?

Thanks.

De: Robert Tupelo-Schneck <schneck@cnri.reston.va.us>
Enviado: miércoles, 23 de noviembre de 2016 17:08:42
Para: Ruiz-Zafra, Angel
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] Guide to user other DBMS
 
I don't know why this would have changed for you.  Presumably a handle client is being initialized before the server listeners are available, but it's not clear why that is happening only when you use the custom storage.  The problem is merely cosmetic, however.

Robert

On 2016-11-23, at 10:17, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:

Yes exactly.

So far I have been working withouth any problem with a classical instance of Handle (Berkeley)...

The error connection could be because the configuration (config file) or related with source code?.

Thanks.



De: Robert R Tupelo-Schneck <schneck@cnri.reston.va.us>
Enviado: miércoles, 23 de noviembre de 2016 15:40:41
Para: Ruiz-Zafra, Angel
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] Guide to user other DBMS
 
You can probably ignore the "Error refreshing root info".  On startup the handle resolver tries to connect to the GHR to see if there is updated GHR information.  Since you are trying to connect to 127.0.0.1 I assume you have configured your handle resolver to send GHR requests to localhost?

Robert

On Nov 23, 2016, at 9:25 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:

Yes, that was what I did but didn't work.

The error was "Unsupported major.minor version 52.0". Recompile with v7 and now works fine.

I already have errors but I asumme that are related with my code or even firewall:

Error refreshing root info: HandleException (CANNOT_CONNECT_TO_SERVER) 127.0.0.1: java.net.ConnectException: Conexión rehusada
HandleException (CANNOT_CONNECT_TO_SERVER) 127.0.0.1: java.net.ConnectException: Conexión rehusada


Thanks.


De: Robert R Tupelo-Schneck <schneck@cnri.reston.va.us>
Enviado: miércoles, 23 de noviembre de 2016 15:09:40
Para: Ruiz-Zafra, Angel
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] Guide to user other DBMS
 
Indeed, the key is: java.lang.ClassNotFoundException: net.handle.server.MongoDBHandle

You can add the dependencies for your custom storage to the "lib" directory of the Handle.net software distribution, which should allow the software to find them.

Robert

> On Nov 23, 2016, at 9:05 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:
> 
> Testing now start the server:
> 
> Error: net.handle.server.MongoDBHandle
>        (see the error log for details.)
> 
> Shutting down...
> 
> In the error log:
> 
> "2016-11-23 14:03:23.769+0100" 25 Started new run.
> "2016-11-23 14:03:23.769+0100" 25 Handle.net Server Software version 8.1.1
> Error refreshing root info: HandleException (CANNOT_CONNECT_TO_SERVER) 127.0.0.1: java.net.ConnectException: Conexión rehusada
> HandleException (CANNOT_CONNECT_TO_SERVER) 127.0.0.1: java.net.ConnectException: Conexión rehusada
> at net.handle.hdllib.HandleResolver.sendHttpOrHttpsRequest(HandleResolver.java:2989)
> at net.handle.hdllib.HandleResolver.sendHttpRequest(HandleResolver.java:2901)
> at net.handle.hdllib.HandleResolver.sendRequestToInterface(HandleResolver.java:2293)
> at net.handle.hdllib.HandleResolver.sendRequestToServerByProtocol(HandleResolver.java:1950)
> at net.handle.hdllib.HandleResolver.sendRequestToServerByProtocol(HandleResolver.java:1810)
> at net.handle.hdllib.HandleResolver.sendRequestToServerInSiteByProtocol(HandleResolver.java:1641)
> at net.handle.hdllib.HandleResolver.sendRequestToSite(HandleResolver.java:1619)
> at net.handle.hdllib.HappyEyeballsResolver.sendRequestToSiteViaProtocol(HappyEyeballsResolver.java:211)
> at net.handle.hdllib.HappyEyeballsResolver.sendRequestToSites(HappyEyeballsResolver.java:178)
> at net.handle.hdllib.HappyEyeballsResolver.sendRequestAndSetResponseOrPublicException(HappyEyeballsResolver.java:153)
> at net.handle.hdllib.HappyEyeballsResolver.run(HappyEyeballsResolver.java:93)
> at net.handle.hdllib.HandleResolver.sendRequestToService(HandleResolver.java:1193)
> at net.handle.hdllib.HandleResolver.processRequest(HandleResolver.java:719)
> at net.handle.hdllib.HandleResolver.processRequest(HandleResolver.java:736)
> at net.handle.hdllib.Configuration.resolveHandleCertified(Configuration.java:267)
> at net.handle.hdllib.Configuration.resolveVerifyUpdateAndPersistBootstrapHandles(Configuration.java:186)
> at net.handle.hdllib.Configuration.refreshRootInfoFromNet(Configuration.java:178)
> at net.handle.hdllib.Configuration.access$000(Configuration.java:29)
> at net.handle.hdllib.Configuration$2.run(Configuration.java:308)
> Caused by: java.net.ConnectException: Conexión rehusada
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
> at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
> at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:117)
> at net.handle.hdllib.HandleResolver.sendHttpOrHttpsRequest(HandleResolver.java:2982)
> ... 18 more
> java.lang.ClassNotFoundException: net.handle.server.MongoDBHandle
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:195)
> at net.handle.server.HandleStorageFactory.getStorage(HandleStorageFactory.java:77)
> at net.handle.server.HandleStorageFactory.getStorage(HandleStorageFactory.java:36)
> at net.handle.server.HandleServer.<init>(HandleServer.java:452)
> at net.handle.server.AbstractServer.getInstance(AbstractServer.java:123)
> at net.handle.server.Main.initialize(Main.java:269)
> at net.handle.server.Main.main(Main.java:125)
> Shutting down...
> 
> 
> I assume the error is related with the dependencies..isn't it?
> 
> Thanks.
> De: Robert R Tupelo-Schneck <schneck@cnri.reston.va.us>
> Enviado: miércoles, 23 de noviembre de 2016 14:59:49
> Para: Ruiz-Zafra, Angel
> Cc: handle-info@cnri.reston.va.us
> Asunto: Re: [Handle-info] Guide to user other DBMS
 
> Does anything get printed in the error.log file?
> 
> Robert
> 
>> On Nov 23, 2016, at 6:57 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:
>> 
>> Hi there!
>> 
>> I'm trying to set up a local instance of Handle server supported by MongoDB (instead Berkeley), but trying to set up the server (hdl-server <dir>) and entering the passphrase the process just stop without any error or exception.
>> 
>> The steps that I follow are:
>> 
>> 1) Create a custom source code/class ("MongoDBHandle.java") which implements HandleStorage (the package structure is net.handle.server.MongoDBHandle)
>> 
>> 2) Compile and create a Jar file with this class (mongodb.jar) and with the dependencies.
>> 
>> 3) Copy this file, mongodb.jar, alongside with mongodb dependencies (mongodb-driver, mongo core, etc) into hsj-8.1.1/lib  and svr_1/lib (I just created this folder, just in case)
>> 
>> 4) Modify svr_1/config.dct and add at the end of the server_config block:
>> 
>>    (--others parameters here - server_type, hdl_tcp_config, etc--)
>>     "storage_class" = "net.handle.server.MongoDBHandle"
>>     "storage_type" = "custom"
>>      "storage_config" = {
>>           "database_name" = "handlesystem"
>>           "collection_nas" = "nas"
>>           "collection_handles" = "handles"
>>           "connections_per_host" = "20"
>>           "write_concern" = "1"
>>           "indices" = (
>>              "handle"
>>              "handles.type"
>>              "_lookup" )
>>      }
>> 
>> 5) Set up server (hsj-8.1.1/bin/hdl-server svr_1/)
>> 6) Enter the passphrase
>> 
>> As I mentioned before, at this point, there are no errors, crashs of exception, just give the focus to the bash instead of "start http server", "http request listener", etc etc.
>> 
>> Any suggestion? Could be something wrong related with the source code (MongoDBHandle) or with the configuration?.
>> 
>> Thanks in advance!
>> 
>> _______________________________________________
>> Handle-Info mailing list
>> Handle-Info@cnri.reston.va.us
>> http://www.handle.net/mailman/listinfo/handle-info

_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info