I have attached a sample piece of code I cannot get to work when the laptop is offline (not connected to the LAN). I am trying to get GeoTools to work without a network interface and I cannot get it to work. It works as long as the laptop is connected to a lan. The simple code found below will fail with Corba networking errors when you disable network interfaces.
I have tried running the app with corba set to localhost and null and I have tried removing the corba arguments altogether and it still does not get past the Corba issue. Is there a way to turn off the Corba lookup pragmatically when you go offline to prevent the Corba problem? -----------------------------ATTACHED CODE---------------------------- package test; import java.util.logging.Level; import java.util.logging.Logger; import org.geotools.data.coverage.grid.AbstractGridFormat; import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * * @author greg */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { try { System.out.println("Starting"); CoordinateReferenceSystem crs = AbstractGridFormat.getDefaultCRS(); System.out.println("crs="+crs.toString()); } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } } --------------------- END ATTACHED CODE --------------------------- ---------------------------- ERROR LOG --------------------------------- ec 12, 2008 3:23:00 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init> WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 205.165.199.142; port: 3700" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274) at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69) at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:127) at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:182) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createDataSource(ThreadedEpsgFactory.java:306) at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:384) at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:476) at org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:138) at org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:232) at org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:126) at org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:681) at org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:513) at org.geotools.factory.FactoryRegistry$1.filter(FactoryRegistry.java:190) at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:793) at javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:787) at javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:491) at org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:197) at org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:174) at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:452) at org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:81) at org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:62) at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:176) at org.geotools.referencing.CRS.decode(CRS.java:410) at org.geotools.data.coverage.grid.AbstractGridFormat.<clinit>(AbstractGridFormat.java:97) at gov.noaa.nws.displayGUI.SvrClrGui.initComponents(SvrClrGui.java:1054) at gov.noaa.nws.displayGUI.SvrClrGui.<init>(SvrClrGui.java:197) at gov.noaa.nws.displayGUI.SvrClrGui.main(SvrClrGui.java:343) Caused by: java.lang.RuntimeException: java.net.SocketException: Network is unreachable -----------------------------ATTACHED CODE---------------------------- package test; import java.util.logging.Level; import java.util.logging.Logger; import org.geotools.data.coverage.grid.AbstractGridFormat; import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * * @author greg */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { try { System.out.println("Starting"); CoordinateReferenceSystem crs = AbstractGridFormat.getDefaultCRS(); System.out.println("crs="+crs.toString()); } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } } ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel