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

Re: [Fwd: Re: Other_Issues: java path priority [THREAD ID:1-21F268]]



Hi Rich:

I think the following should work:

Add the following class:

public class NetworkUtils {
public static void initProtocolHandler() {
   // test setting the http protocol handler
   try {
     new java.net.URL( null, "http://motherlode.ucar.edu:8080/";, new 
sun.net.www.protocol.http.Handler());
   } catch (java.net.MalformedURLException e) {
     e.printStackTrace();
   }
}
}

Then call it before you call anything else, ie 
NetworkUtils.initProtocolHandler();

lemme know if it works



Rich Signell wrote:
John,

Can you tell me where I'm supposed to stick this code?

Thanks,
Rich


------------------------------------------------------------------------

Subject:
RE: Other_Issues: java path priority [THREAD ID:1-21F268]
From:
address@hidden
Date:
13 Jan 2006 15:27:57 -0500
To:
address@hidden

To:
address@hidden


Rich,

I am writing in reference to your Service Request # 1-21KOGP regarding 'Topic : 
java path priority'.

I apologize for the delay. It took us a while to get back you and I apologize 
for the inconvenience caused.

I believe the problem is being caused by the fact that MATLAB is registering 
its own http protocol handler.  This problem should be able to be resolved in 
the GridDataset class by registering its own http protocol handler before 
creating a URL Please find the code for doing the same.
      URL serverURL;

      sun.net.www.protocol.http.Handler handler = new 
sun.net.www.protocol.http.Handler();

      if (handler != null)

      {
          serverURL = new URL(null,serverPath,handler);
      }

      else
      {
          serverURL = new URL( serverPath );
      }


Sincerely,

Ram Ramani
Application Support Engineer
Technical Support Department
The MathWorks, Inc.
Phone: (508) 647-7000 option 5


Self-Service:
http://www.mathworks.com/support

File Exchange and Newsgroup Access: http://www.mathworks.com/matlabcentral/





[THREAD ID:1-21F268]



-----Original Message-----

From:  address@hidden
Sent:  2006-01-12 04:30:05 PM
To:  address@hidden
Cc:  John Caron <address@hidden>
Subject:  Other_Issues: java path priority [THREAD ID:1-21F268]

Ram,

John Caron at UNIDATA and I have been waiting, but have still heard nothing from Mathworks developers on this Matlab java issue.

-Rich


address@hidden wrote:

Rich,

I am writing in reference to your Service Request # 1-21KOGP regarding 'Topic : 
java path priority'.

Thank you for the detailed information. I have forwarded the request to our 
developers. I wanted to notify you that our developers are on holiday until Jan 
6th. I will notify you when I get more information on how they want to proceed. 
i apologize for the inconvenience.

Happy New Year,

Sincerely,


Ram Ramani
Application Support Engineer
Technical Support Department
The MathWorks, Inc.
Phone: (508) 647-7000 option 5


Self-Service:
http://www.mathworks.com/support

File Exchange and Newsgroup Access: http://www.mathworks.com/matlabcentral/





[THREAD ID:1-21F268]



-----Original Message-----

From:  address@hidden
Sent:  2005-12-30 09:34:51 AM
To:  address@hidden
Cc:  John Caron <address@hidden>; Sachin Kumar Bhate <address@hidden>
Subject:  Other_Issues: java path priority [THREAD ID:1-21F268]

Rai,

I'm glad that the Mathworks Java developers will be contacting John Caron at Unidata (address@hidden) to get the proplems with Java classpath priority between Matlab and NetCDF-Java worked out.

This is important, as we are planning to develop a new interface between Matlab and NetCDF, using the NetCDF-Java as a foundation.

As you probably know, Mathworks has never provided native support for accessing NetCDF files, despite this being the most widely used scientific format in the Earth Science community (unlike competitor IDL, which has supported NetCDF for years). The burden has thus fallen on the Matlab community to support the interface, which we at USGS did for years before moving the effort to sourceforge (http://mexcdf.sourceforge.net). The problem with the existing interface is two-fold: (1) it requires a machine-dependent mex-file to run, and (2) it doesn't take advantage of higher level routines found in packages like NetCDF-Java that can return grid structures along with requested data.

We hope to remedy these problems by creating a new Matlab-NetCDF interface based on the NetCDF-Java interface. Of course, we would welcome Mathworks comment on this plan, or better yet, actual involvement in the development.

Thanks,

-Rich

address@hidden wrote:


Rich,

I am writing in reference to your Service Request # 1-21KOGP regarding 'Topic : 
java path priority'.

The open method is trying to make an http request. From within MATLAB, it's using  our 3rd part libraries from 
“ice�, which do the support for browser type operations.  The ice 
code may have different security defaults, or there may be a bug.  We are not sure at this point as to what may be going wrong. I will get back to you 
as soon as I receive more information.

Sincerely,

Ram Ramani
Application Support Engineer
Technical Support Department
The MathWorks, Inc.
Phone: (508) 647-7000 option 5


Self-Service:
http://www.mathworks.com/support

File Exchange and Newsgroup Access: http://www.mathworks.com/matlabcentral/





[THREAD ID:1-21F268]



-----Original Message-----

From:  address@hidden
Sent:  2005-12-19 05:20:03 PM
To:  address@hidden
Subject:  Other_Issues: java path priority

Subject area: other

mySubject: java path priority

Salutation: Dr.

First Name: Rich

Middle Name:
Last Name: Signell

Email: address@hidden

Phone: 508 457 2229

Program: Neither

License: 1186

Product Release: R14SP2

Products used: MATLAB

Platform: Linux

Operating System: RedHat Linux

myTopic: Other_Issues: java path priority

Reproduction steps: get this jar file:
http://stellwagen.er.usgs.gov/rps/share/toolsUI-2.2.13.jar
add to JAVA classpath.
Then in Matlab, try this:
import ucar.nc2.*
import ucar.nc2.dataset.grid.*
import ucar.nc2.dataset.grid.GridDataset.*
a=GridDataset.open('http://stellwagen.er.usgs.gov/rps/share/test_topo.nc');



Whats wrong: Matlab should return with a GridDataset object, but it throws this 
exception:
??? Java exception occurred: ice.net.URLNotFoundException: Document not found on server
        at ice.net.HttpURLConnection.getInputStream(OEAB)
        at ice.net.HttpURLConnection.getResponseCode(OEAB)
        at ucar.nc2.dataset.NetcdfDataset.isDODS(NetcdfDataset.java:305)
        at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:282)
        at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:148)
        at 
ucar.nc2.dataset.NetcdfDatasetCache.acquire(NetcdfDatasetCache.java:190)
        at 
ucar.nc2.dataset.NetcdfDatasetCache.acquire(NetcdfDatasetCache.java:170)
        at ucar.nc2.dataset.grid.GridDataset.open(GridDataset.java:65).

Error Messages: It appears that Matlab is overriding java.net with ice.net, and 
therefore the program is bombing.  I got this to work one time, and I thought 
it was by adding my .jar to the beginning of the static java path (in the 
classpath.txt file) but now that doesn't work either.  How can I ensure that 
java.net is found instead of ice.net?

ver: >> ver
-------------------------------------------------------------------------------------
MATLAB Version 7.0.4.352 (R14) Service Pack 2
MATLAB License Number: 1186
Operating System: Linux 2.6.9-22.0.1.ELsmp #1 SMP Tue Oct 18 18:39:27 EDT 2005 
i686
Java VM Version: Java 1.5.0 with Sun Microsystems Inc. Java HotSpot(TM) Client 
VM
-------------------------------------------------------------------------------------
MATLAB                                                Version 7.0.4      
(R14SP2)
M_Map - mapping toolbox (Author: address@hidden) Version 1.3 SEAWATER Library Version 2.0.1 Signal Processing Toolbox Version 6.3 (R14SP2)

File1: File2: File3:
Solutions already tried: 1-21DVN2, 1-21DWC0

Form Page URL: /support/contact_us/ts/help_request_2.html?respFormData=1593