我在Windows 7上启动Eclipse Helios时收到此错误消息:
无法创建Java虚拟机

我的eclipse.ini看起来如下:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
-vm
P:\Programs\jdk1.6\bin
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms120m
-Xmn100m
-Xmx1024m
Run Code Online (Sandbox Code Playgroud)
据我所知,我的JAVA_HOME设置正确.我怎样才能解决这个问题?
-vm
P:\Programs\jdk1.6\bin\\bin\javaw.exe-vm完全删除选项--launcher.XXMaxPermSize修复了问题,但它导致permgen错误512的--launcher.XXMaxPermSize修复问题,但它会导致PermGen的错误-Xmx至512m还修复该问题.为什么我不能将'1024m'用于'-Xmx'和'--launcher.XXMaxPermSize'?
我正在寻找一个关于如何在SQLite和Android中使用ORMLite的好的入门教程.一个qucick谷歌搜索没有产生任何有用的信息.
我正在使用与tomcat的eclipse.在服务器(右键单击)选项卡上,您可以选择:清理,发布和清理Tomcat工作目录,这些选项实际上做了什么以及它们与项目有何不同>构建
我有2个模板
<template match="vehicle_details[preceding-sibling::vehicle_type = '4x4']/*">
...
</xsl:template>
<xsl:template match="vehicle_details[descendant::color = 'red']/*" >
...
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
我的问题是:哪个模板优先于转换.有人可以给我一个关于XSL模板优先级的概述/资源吗?
提前致谢!
我想限制SQL表中的列值.例如,列值只能是"car"或"bike"或"van".我的问题是你如何在SQL中实现这一点,并且在数据库方面这样做是一个好主意,或者我应该让应用程序限制输入.
我还打算将来添加或删除更多值,例如"truck"
我使用的数据库类型是SQLite和MySQl
我知道您可以在web.xml中指定错误页面,如下所示
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)
我发现列出每个错误代码的页面有点乏味.我想知道在这种情况下最常见的做法是什么!有没有更好的方法来自动生成这些页面,例如使用JSP或servlet或通过Spring或Stripes?
下面的单元测试失败。我正在打印请求和响应,并且可以确认 MockRestServiceServer 在调用端点时返回模拟的 JSON。当我更改测试以直接与服务器通信时,单元测试通过。不知道我做错了什么
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = {Application.class, Beans.class})
public class BillingSystemClientImplTest {
private MockRestServiceServer mockServer;
@Autowired
private RestTemplate restTemplate;
@Autowired
private Properties properties;
@Autowired
private BillingSystemClient client;
@Before
public void setUp() {
mockServer = MockRestServiceServer.createServer(restTemplate);
}
@Test
public void testGetAccount() throws Exception {
Resource resource = new ClassPathResource("/account.json", getClass());
UriComponents uri = UriComponentsBuilder.fromUriString(properties.getAccountResource())
.buildAndExpand("53737803");
mockServer.expect(requestTo(uri.toUriString()))
.andExpect(method(HttpMethod.GET))
.andRespond(withSuccess(resource, MediaType.APPLICATION_JSON));
AccountResponse response = client.getAccount("53737803");
Assert.assertNotNull(response.getAccountNumber());
mockServer.verify();
}
}
Run Code Online (Sandbox Code Playgroud)
下面的异常抱怨响应对象为空。这个对象是从响应映射的
response = restTemplate.getForObject(uriComponents.toUri(), AccountResponse.class);
Run Code Online (Sandbox Code Playgroud)
和例外
java.lang.NullPointerException
at com.something.ws.client.BillingSystemClientImplTest.testGetAccount(BillingSystemClientImplTest.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) …Run Code Online (Sandbox Code Playgroud)