Skip to main content

Conversion to 2.6

8 replies [Last post]
turbogeek
Offline
Joined: 2003-06-10

Looking for an equivalent to the AdvertisementFactory.newAdvertisement() method.
I have been using it to do some of my persistence of Advertisement types.

There seem to be quite a few methods that have been deleted, but there is no documentation on what has been changed. Where is the documentation on how to migrated?

Here is an example of what I was doing to read an Advertisement:

Reader advReader = new InputStreamReader(advStream, "UTF-8");
PresenceAdv pc = (PresenceAdv)AdvertisementFactory.newAdvertisement(MimeMediaType.XMLUTF8, advReader);

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
turbogeek
Offline
Joined: 2003-06-10

Sadly and happily I found part of the answer. There was an instruction for conversion of the now deleted code, but I had to look in 2.5 rather than 2.6. Either put it in a doc or leave the info in the code as part of the class documentation. We should not be making it any harder on folks to fix their code for a new release. Saving 5 minutes of time can translate to hours of work for the end user.

Back to the conversion. Has something changed in how JXTA is started? I am running into an issue where my RDV/Relay is not being found by my edge. I can hit the http address for the server and it gives me the hello message, so it is up and visible.

I am also getting a lot of these messages in my edge:
Line 780 net.jxta.impl.rendezvous.edge.EdgePeerRdvService$MonitorTask.execute()
Rendezvous connection stalled until router is started!

Message was edited by: turbogeek

turbogeek
Offline
Joined: 2003-06-10

Looking through my logs, I also found this:

Line 996 net.jxta.impl.rendezvous.rpv.PeerView.seed()
New Seeding...
Line 2062 net.jxta.impl.rendezvous.rpv.PeerView$KickerTask.run()
Uncaught Throwable in thread : JxtaWorker-51
java.lang.NullPointerException

Earlier in the process I also fail when creating a BiDi pipe in the following code (endpoint or the result of setEndpointRouter() is a null):

private RouteController getRouteControl() {
if (routeControl == null) {
routeControl = endpoint.getEndpointRouter().getRouteController();
}
return routeControl;
}
Here is the stack for this error:
ava.lang.NullPointerException
at net.jxta.impl.resolver.ResolverServiceImpl.getRouteControl(ResolverServiceImpl.java:1114)
at net.jxta.impl.resolver.ResolverServiceImpl.sendQuery(ResolverServiceImpl.java:506)
at net.jxta.impl.resolver.ResolverServiceInterface.sendQuery(ResolverServiceInterface.java:173)
at net.jxta.impl.pipe.PipeResolver.sendPipeQuery(PipeResolver.java:1147)
at net.jxta.impl.pipe.PipeServiceImpl.createOutputPipe(PipeServiceImpl.java:561)
at net.jxta.impl.pipe.PipeServiceImpl.createOutputPipe(PipeServiceImpl.java:496)
at net.jxta.impl.pipe.PipeServiceImpl.createOutputPipe(PipeServiceImpl.java:487)
at net.jxta.impl.pipe.PipeServiceInterface.createOutputPipe(PipeServiceInterface.java:187)
at net.jxta.util.JxtaBiDiPipe.connect(JxtaBiDiPipe.java:368)
at net.jxta.util.JxtaBiDiPipe.connect(JxtaBiDiPipe.java:328)
at net.jxta.util.JxtaBiDiPipe.(JxtaBiDiPipe.java:273)

turbogeek
Offline
Joined: 2003-06-10

More info.... sorry but it is tough reading through hundreds of lines in a log file...

for some reason it isn't coming up as a normal stack trace so it was easy to miss. Here is the log leading to the error which looks like it is barfing on my NetPeerGroup. Note that I have my own private NPG so I'll ask again, has this changed any?

Already an Edge peer -- No Switch is needed.
Line 547 net.jxta.impl.discovery.DiscoveryServiceImpl.startApp()
Discovery service started
Line 123 net.jxta.impl.cm.InMemorySrdi.()
[urn:jxta:jxta-WorldGroup[0,1542795923] / [1061818337]] : Initialized routerSrdi
Line 121 net.jxta.impl.cm.Srdi.()
[urn:jxta:jxta-WorldGroup[0,1542795923] / [1061818337]] : Starting SRDI GC Thread for routerSrdi
Line 360 net.jxta.impl.endpoint.router.EndpointRouter.getMyLocalRoute()
no Endpoint SVC Params
Line 443 net.jxta.impl.peergroup.StdPeerGroup.startModules()
Exception in startApp() : net.jxta.impl.endpoint.router.EndpointRouter@2a9a42ef
java.lang.NullPointerException
Line 445 net.jxta.impl.endpoint.router.RouteCM.publishRoute()
Line 795 net.jxta.impl.endpoint.router.EndpointRouter.startApp()
Line 439 net.jxta.impl.peergroup.StdPeerGroup.startModules()
Line 649 net.jxta.impl.peergroup.StdPeerGroup.initFirst()
Line 211 net.jxta.impl.peergroup.Platform.initFirst()
Line 968 net.jxta.impl.peergroup.GenericPeerGroup.init()
Line 306 net.jxta.peergroup.WorldPeerGroupFactory.newWorldPeerGroup()
Line 178 net.jxta.peergroup.WorldPeerGroupFactory.()
Line 203 net.jxta.peergroup.NetPeerGroupFactory.()
Line 417 com.jxta.commons.config.NetworkManager25.startNetwork()

turbogeek
Offline
Joined: 2003-06-10

Ok, a little closer.

I have disabled my infrastructure network and also deleted any config files and cm, so I think I am down to minimum. I am also just running http and I still am able to see the RDV via a web browser. The key error now happens when the network is started. Here is the excepetion, any ideas?

Line 360 net.jxta.impl.endpoint.router.EndpointRouter.getMyLocalRoute()
no Endpoint SVC Params
Line 443 net.jxta.impl.peergroup.StdPeerGroup.startModules()
Exception in startApp() : net.jxta.impl.endpoint.router.EndpointRouter@df5cbd6
java.lang.NullPointerException
Line 445 net.jxta.impl.endpoint.router.RouteCM.publishRoute()
Line 795 net.jxta.impl.endpoint.router.EndpointRouter.startApp()
Line 439 net.jxta.impl.peergroup.StdPeerGroup.startModules()
Line 649 net.jxta.impl.peergroup.StdPeerGroup.initFirst()
Line 211 net.jxta.impl.peergroup.Platform.initFirst()
Line 968 net.jxta.impl.peergroup.GenericPeerGroup.init()
Line 306 net.jxta.peergroup.WorldPeerGroupFactory.newWorldPeerGroup()
Line 178 net.jxta.peergroup.WorldPeerGroupFactory.()
Line 203 net.jxta.peergroup.NetPeerGroupFactory.()
Line 410 net.jxta.platform.NetworkManager.startNetwork()
Line 368 com.cluck.quantum.jxta.JxtaControler.startJxta()

turbogeek
Offline
Joined: 2003-06-10

Ok, here is the latest on figuring out part of the problem.

First, this is being thrown in a log message inside RouteCM. Here is the line:

Logging.logCheckedFine(LOG, "Publishing route for ", route.getDestPeerID());

Basically there is an unchecked null here. Bad programmer, bad!

This is being called from REndpointRouter.getMyLocalRoute() which is passing the offending null.

if (endpParam == null) {

Logging.logCheckedSevere(LOG, "no Endpoint SVC Params");

// Return whatever we had so far.
return localRoute;

}

I might still be able to make this work as is but need to understand how to turn off the logger. Tried it, but no success with the following:
Logger LOGFoo = Logger.getLogger("net.jxta.impl.endpoint.router.RouteCM");
LOGFoo.setLevel(Level.OFF);

Any ideas on how to turn off the log and maybe why this is getting a null?

adamman71
Offline
Joined: 2007-01-31

This condition has not been encountered during testing. Do we know how to replicate it?

Turning off the Logger probably won't work, because I believe it is the route.getDestPeerID() which is causing the problem.

I could add a small test on null route.

turbogeek
Offline
Joined: 2003-06-10

Queue up the primal scream... The issue seems to be that I had a 2.5 PlatformConfig in the path. The issue seemed to be that it was ignoring my new config. It seemed to ignore the home dir at least initially. It did create new files where I told it, so I just assumed it was reading that one.

Might be good to add a log of the load of the config in the INFO log with the full path.

Still not running right with 2.6, but now I am at least connecting to my RDV.

FYI when it was not working, I was able to get around the null pointer by setting the properties before JXTA loaded.
System.setProperty("net.jxta.logging.Logging", "OFF");
System.setProperty("net.jxta.level", "OFF");

The logger seems a little dysfunctional. It appears that the JXTA logging can only be configured at startup and their is no direct way to change logging level at runtime. It seems that this implementation causes the standard logger to be ignored, including logging levels for specific classes.

adamman71
Offline
Joined: 2007-01-31

There has been some work done on the config file, because the separation between TCP and multicast has been finalized. So, I am not surprize that you would encounter an issue with old 2.5 config.

What do you mean by still not running with 2.6? What is not working?

I will add a test again null pointer to remove that log glitch.