小编Abh*_*Das的帖子

尝试加载JRI时找不到依赖库

我有这段简单的代码试图加载JRI模块.

 public static void main(String... args) {
    System.out.println(System.getProperty("java.library.path").toString());
    System.setProperty("jri.ignore.ule", "yes");
    System.loadLibrary("jri");
}
Run Code Online (Sandbox Code Playgroud)

我将java.library.path作为VM参数传递,但JRI无法加载以下错误:

C:\Users\Abhishek\Documents\R\win-library\3.1\rJava\jri;C:\Users\Abhishek\Documents\R\win-library\3.1\rJava
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Abhishek\Documents\R\win-library\3.1\rJava\jri\jri.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at pack.TestJRI.main(TestJRI.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Run Code Online (Sandbox Code Playgroud)

在此先感谢您的帮助.

r jri

6
推荐指数
1
解决办法
1349
查看次数

调用GeometryJSON()。read()时发生NoSuchMethodException

我正在使用JTS(来自VividSolutions)和GeoTools。我有以下代码:

public Geometry jsonToGeom(String json) throws IOException {
    Geometry obj = new GeometryJSON().read(json);
    return obj;
}
Run Code Online (Sandbox Code Playgroud)

但是,这将返回以下RunTimeException:

java.lang.RuntimeException: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureHandler.<init>(com.vividsolutions.jts.geom.GeometryFactory)
at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:130)
at org.geotools.geojson.geom.GeometryHandler.primitive(GeometryHandler.java:68)
at org.json.simple.parser.JSONParser.parse(Unknown Source)
at org.json.simple.parser.JSONParser.parse(Unknown Source)
at org.geotools.geojson.GeoJSONUtil.parse(GeoJSONUtil.java:236)
at org.geotools.geojson.geom.GeometryJSON.parse(GeometryJSON.java:655)
at org.geotools.geojson.geom.GeometryJSON.read(GeometryJSON.java:196)
at am.abhi.experiments.geotoolstest.GeoJson.jsonToGeom(GeoJson.java:13)
at am.abhi.experiments.geotoolstest.SomeTest.testSomething(SomeTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) …
Run Code Online (Sandbox Code Playgroud)

java jts geotools

5
推荐指数
1
解决办法
1181
查看次数

向 Pentaho Kettle 添加新数据类型

我正在尝试向 Kettle 添加新的数据类型(几何)。我已向 org.pentaho.di.compatibility 添加了一个新的值类型。我添加了一个 ValueGeometry 类并对 ValueInterface 和 Value 进行了必要的修改。代码可以编译,但新的数据类型不会显示在 Select 等插件中。我在这里缺少什么?另外,如果您能向我指出这些插件的源代码,我将不胜感激。

谢谢。

java pentaho kettle

5
推荐指数
1
解决办法
1228
查看次数

Cherrypy出现“不存在'Access-Control-Allow-Origin'标头”错误

我在HTML页面中有以下javascript

<script>
    function getContent(page)
    {
        var xmlhttp;
        if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp=new XMLHttpRequest();
            }
        else
            {// code for IE6, IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
             {
                var json = xmlhttp.responseText;
                obj = JSON.parse(json);
                document.getElementById("content").innerHTML=obj.content;
                document.getElementById("title").innerHTML=obj.title;
             }
        }
    xmlhttp.open("GET","http://differentserver.com:8080?page="+page,true);
    xmlhttp.send();
}
</script>
Run Code Online (Sandbox Code Playgroud)

和一个使用cherrypy的python脚本,该脚本提供JSON,其代码为:

import cherrypy
import json

class ContentGeneratorService(object):
exposed = True
@cherrypy.tools.accept(media='text/plain')
def GET(self, page='home'):
    file_title = open(page + '.title', 'r')
    file_content = open(page + '.content', 'r')
    return json.dumps({"title": file_title.read().replace('\n', …
Run Code Online (Sandbox Code Playgroud)

javascript python json cherrypy

4
推荐指数
1
解决办法
3230
查看次数

标签 统计

java ×2

cherrypy ×1

geotools ×1

javascript ×1

jri ×1

json ×1

jts ×1

kettle ×1

pentaho ×1

python ×1

r ×1