英文:
Setting up Custom class Object as Key/value in Apache Geode
问题
我正在我的一个网页应用程序中使用Apache Geode。
我正在在Apache Geode的cache-server.xml文件中将自定义类用作值约束。
如果在XML文件中未指定value-constraint,则我可以启动服务器。但是,如果指定了value-constraint,那么在运行服务器时我会收到以下错误消息:
Exception in thread "main" org.apache.geode.cache.CacheXmlException: 读取缓存XML文件:/C:/localfolder/cache-server.xml时。无法加载value-constraint类:myPackage.Test,原因是java.lang.ClassNotFoundException: myPackage.Test
以下是我的startserver.bat文件内容:
> gfsh start server --server-port=12000 --dir=C:\localfolder\server
> --name=server123 --hostname-for-clients="someHost" --initial-heap=500m --max-heap=500m --bind-address="someAddress" --properties-file=gemfire.properties --server-properties-file=gfsecurity.properties --classpath="C:\localfolder\application.war"
请告诉我:
- 如何在XML文件中提供自定义类对象作为键值约束?
- 如何在服务器启动过程中使用war文件?
英文:
I am using Apache Geode in one of my web applications.
I am using Custom class as a value-constraint in Apache Geode cache-server.xml file.
If value-constraint is not specified in the XML file, then I am able to start the server. But if value-constraint is specified then while running the server I am getting below error
Exception in thread "main" org.apache.geode.cache.CacheXmlException: While reading Cache XML file:/C:/localfolder/cache-server.xml. Could not load value-constraint class: myPackage.Test, caused by java.lang.ClassNotFoundException: myPackage.Test
Below is my startserver.bat file contents
> gfsh start server --server-port=12000 --dir=C:\localfolder\server
> --name=server123 --hostname-for-clients="someHost" --initial-heap=500m --max-heap=500m --bind-address="someAddress" --properties-file=gemfire.properties --server-properties-file=gfsecurity.properties --classpath="C:\localfolder\application.war"
Please let me know
- How to provide a custom class objects as a key-value constraint in the XML file?
- How to use war file, in the server start process?
答案1
得分: 1
以下是翻译好的内容:
类路径(Gfsh选项,以及通常用于java
启动器)不能引用WAR文件;必须是一个包含您的应用程序域类的JAR文件。
WAR文件和JAR文件具有相似但明显不同的格式。
英文:
The classpath (Gfsh option, and in general, to the java
launcher) cannot refer to a WAR file; must be a JAR file (containing your application domain classes).
WAR files and JAR files have similar, but significantly different formats.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论