在使用maven的eclipse中,我添加了一个依赖项作为本地jar文件,如下所示:
<dependency>
<groupId>xyz-core</groupId>
<artifactId>xyz-core</artifactId>
<version>0</version>
<scope>system</scope>
<systemPath>/home/xyz/xyz-core.jar</systemPath>
</dependency>
Run Code Online (Sandbox Code Playgroud)
在这个jar文件中,我有一个在我的应用程序中使用的接口.
当我在tomcat服务器上运行我的应用程序它显示该接口的异常
Exception sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: com/mxgraph/canvas/mxICanvas2D
Run Code Online (Sandbox Code Playgroud)
虽然mxICanvas2D是一个界面.
我刚刚安装了documentum的开发人员版本,该版本在窗口7上成功运行。但是,每当我重新启动系统时,登录页面的下拉列表中都没有任何存储库。请帮助我
我想为spring restful web服务实现测试用例,它返回一个json MY控制器测试类是:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {WebAppContext.class,JpaTestConfiguration.class
})
@WebAppConfiguration
public class DominProfileRestControllerTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext webApplicationContext;
private MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(),
MediaType.APPLICATION_JSON.getSubtype(),
Charset.forName("utf8"));
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}
@Test
public void testGetDomainProfile() throws Exception {
String profileId = domainProfile.getId().toString();
System.out.print("testing restful"+profileId);
mockMvc.perform(get("/service/domainprofile/get/{id}", profileId) )
.andExpect(status().isOk())
.andExpect(content().contentType(contentType))
.andExpect(jsonPath("$.city", is("Chandigrah")));
/* mockMvc.perform(get("/service/domainprofile/get/{id}",profileId).accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk())
.andExpect(content().contentType("text/plain;charset=ISO-8859-1"))
.andExpect(content().string("hello Prashant"));
*/
}
Run Code Online (Sandbox Code Playgroud)
我的Controller类是:
@RestController
@RequestMapping("/service/domainprofile")
public class DominProfileRestController {
@Autowired
private JpaDomainProfileRepository jpaDomainProfileRepository;
@RequestMapping(value = "/get/{id}", …Run Code Online (Sandbox Code Playgroud) 我正在研究java中的一些项目.在这里,我坚持这个问题,无法弄清楚我哪里出错了.
我做了两个课:Test和Child.
当我运行代码时,我得到一个NullPointerException.
package com.test;
public class Test {
child newchild = new child();
public static void main(String[] args) {
new Test().method();
}
void method() {
String[] b;
b = newchild.main();
int i = 0;
while (i < b.length) {
System.out.println(b[i]);
}
}
}
Run Code Online (Sandbox Code Playgroud)
package com.test;
public class child {
public String[] main() {
String[] a = null;
a[0] = "This";
a[1] = "is";
a[2] = "not";
a[3] = "working";
return a;
}
}
Run Code Online (Sandbox Code Playgroud)