|
Вызов webservice из java класса
|
|||
---|---|---|---|
#18+
Добрый день. Пытаюсь выполнить метод веб сервиса, используя при этом HttpURLConnection. При выполнении метода connect() этого класса генерируется исключение: <> Unhandled Java Exception: java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainSocketImpl at java.net.Socket.<init>(Socket.java:117) at sun.net.NetworkClient.doConnect(NetworkClient.java:144) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.<init>(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) Сервер: Adaptive Server Enterprise/15.5/EBF 18373 SMP ESD#3/P/NT (IX86)/Windows 2003/asear155/2531/32-bit/OPT/Fri Jan 14 01:57:26 2011 Выделение блоков кода по какой то причине не работает, прошу прощения что так вставил: public static void WebCallWithResult(String address) throws Exception { try { URL url = new URL(address); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); System.out.println("conn.setRequestMethod('GET')"); Map propMap = conn.getRequestProperties(); Set propSet = propMap.entrySet(); Iterator itr = propSet.iterator(); while (itr.hasNext()) { Map.Entry propEntry = (Map.Entry) itr.next(); System.out.println(propEntry.getKey() + ":" + propEntry.getValue()); } System.out.println("before conn.connect();"); conn.connect(); System.out.println("after conn.connect();"); InputStream in = conn.getInputStream(); При этом есть описание решения проблемы: http://search.sybase.com/search/simple.do Строка поиска - java.lang.NoClassDefFoundError: Could not initialize class java.net.PlainSocketImpl Solved Cases (#11602274)-Adaptive Server Enterprise 1503-Sun Solaris SPARC Но посмотреть его я не могу. В документации написано, что для использования java.net.* необходимо выполнить команду sp_configure "number of java sockets", 10. Выполнял, сервер перезагружал. Что необходимо еще выполнить для устранения этой ошибки? ... |
|||
:
Нравится:
Не нравится:
|
|||
07.06.2012, 16:44 |
|
Вызов webservice из java класса
|
|||
---|---|---|---|
#18+
case 11602274 Adaptive Server Enterprise 15.5 > Java in Adaptive Server Enterprise Adaptive Server Enterprise 15.5 > Additional Topics ------------------------------------------------------------------- Avoid SQL loops in a multi-engine environment Unsupported Java API packages, classes, and methods Chapter 9: Additional Topics Controlling access to native methods in the PCA/JVM The Java language lets you use functionality implemented in non-Java languages through the Java Native Interface (JNI) via native methods. Classes using native methods must explicitly load the native library using either the load(String filename) or loadLibrary(String libname) method as described in both the java.lang.System and java.langRuntime classes. Because these libraries are not stored as controlled objects in the database, some users may consider them less secure. To prevent unexpected access to native libraries, the PCA/JVM has introduced a system property sybase.allow.native.lib to control the loading of native libraries. Many Java properties can be set either on the command line or from within the application via the java.lang.System setProperty(String key, String value) method. However, this is forbidden by the SecurityManager to prevent users from overriding system policy. By default, users cannot load native libraries. If an attempt is made to load a native library or alter the existing property setting, a SecurityException is raised and the load attempt fails. For example, if you try to load the java.net.ServerSocket class without setting the sybase.allow.native.lib property, the initializer fails because it requires the Socket library to be loaded. The actual Java stack varies. However, it or the client message displays: java.lang.SecurityException: Cannot load native libraries from within a user Task! This indicates that a required native library has been unable to load. To enable loading of native libraries, set this property in the sybpcidb database prior to starting the JVM: 1> sp_jreconfig "add","pca_jvm_java_option","-Dsybase.allow.native.lib=true" 2> go ... |
|||
:
Нравится:
Не нравится:
|
|||
07.06.2012, 17:57 |
|
|
start [/forum/topic.php?fid=55&msg=37830012&tid=2010120]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
189ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
112ms |
get tp. blocked users: |
2ms |
others: | 40ms |
total: | 382ms |
0 / 0 |