我正在JBOSS EAP 6.2中開發和部署RESTful服務。對於這個任務,我使用CXF,Spring和Embedded Derby來存儲數據。 我花了幾個小時試圖調試這個錯誤,但無法實現它。我已經多次檢查過數據庫是完全空的,沒有任何表。但我總是收到相同的堆棧跟蹤。 我也讀過類似的問題,但這也沒有幫助。 所以,這裏是代碼:java.sql.SQLException:Schema'APP'中已存在表/視圖'LOCATION'
資源類
package rest_3;
import java.sql.SQLException;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@Path("/dataservice")
@Produces({"application/xml", "application/json"})
@Consumes({"application/xml", "application/json"})
public class DataService {
private ApplicationContext context = new ClassPathXmlApplicationContext("rest_3/servicebean.xml");
private DAO dao = (DAO) context.getBean("daoBean");
public DataService(DAO dao) {
}
@GET
@Path("/location/{id}")
public Location getLocation(@PathParam("id") int id) throws SQLException {
Location loc = dao.getLocation(id);
if (loc == null) {
ResponseBuilder builder = Response.status(Status.BAD_REQUEST);
builder.type("application/xml");
builder.entity("<error>Location Not Found</error>");
throw new WebApplicationException(builder.build());
}
return loc;
}
@POST
@Path("/location")
public Response addLocation(Location loc) throws SQLException {
if(loc == null)
return Response.status(Status.BAD_REQUEST).build();
dao.addLocation(loc);
return Response.ok().build();
}
@DELETE
@Path("/location/{id}")
public Response deleteLocation(@PathParam("id") int id) throws SQLException {
Location loc = dao.getLocation(id);
if(loc == null)
return Response.status(Status.BAD_REQUEST).build();
dao.deleteLocation(id);
return Response.ok().build();
}
@PUT
@Path("/location")
public Response updateLocation(Location loc) throws SQLException {
if(dao.getLocation(loc.getId()) == null)
return Response.status(Status.BAD_REQUEST).build();
dao.updateLocation(loc);
return Response.ok().build();
}
@DELETE
@Path("/location")
public void dropTable() throws SQLException {
dao.dropTable();
}
}
DAO類
package rest_3;
import java.sql.*;
import org.apache.derby.jdbc.EmbeddedDataSource;
public class DAO {
private static Connection conn;
private static Statement statement;
private static PreparedStatement prep;
public DAO() throws SQLException {
this.load();
}
public void load() throws SQLException {
EmbeddedDataSource ds = new EmbeddedDataSource();
ds.setDatabaseName("derbyDB");
ds.setCreateDatabase("create");
conn = ds.getConnection();
statement = conn.createStatement();
statement.execute("create table location(id int, country varchar(40))");
statement.execute("insert into location values(1, 'MEXICO')");
statement.execute("insert into location values(2, 'SPAIN')");
statement.execute("insert into location values(3, 'UK')");
statement.execute("insert into location values(4, 'ITALY')");
statement.execute("insert into location values(5, 'JAPAN')");
}
public Location getLocation(int id) throws SQLException {
ResultSet rs = statement.executeQuery("select from location where id = " + id);
rs.next();
return new Location(rs.getInt("id"), rs.getString("country"));
}
public void addLocation(Location loc) throws SQLException{
int id = loc.getId();
String country = loc.getCountry();
prep = conn.prepareStatement("insert into location values(?,?)");
prep.setInt(1, id);
prep.setString(2, country);
prep.execute();
}
public void deleteLocation(int id) throws SQLException{
statement = conn.createStatement();
statement.executeUpdate("delete from location where id = " + id);
}
public void updateLocation(Location loc) throws SQLException {
int id = loc.getId();
String country = loc.getCountry();
statement = conn.createStatement();
statement.execute("update location set country = " + country + " where id = " + id);
}
public void dropTable() throws SQLException {
statement = conn.createStatement();
statement.execute("drop table location");
}
}
服務和DAO豆。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="dataService" class="rest_3.DataService">
<constructor-arg ref ="daoBean"/>
</bean>
<bean id="daoBean" class="rest_3.DAO">
</bean>
</beans>
服務豆配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxrs:server id="DataService" address="/">
<jaxrs:features>
<cxf:logging/>
</jaxrs:features>
<jaxrs:serviceBeans>
<ref bean="dataService" />
</jaxrs:serviceBeans>
</jaxrs:server>
</beans>
的web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/beans.xml
classpath:rest_3/servicebean.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
堆棧跟蹤:
16:28:05,892 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/rest_3]] (ServerService Thread Pool -- 47) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DataService': Cannot resolve reference to bean 'dataService' while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataService' defined in class path resource [rest_3/servicebean.xml]: Cannot resolve reference to bean 'daoBean' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoBean' defined in class path resource [rest_3/servicebean.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [rest_3.DAO]: Constructor threw exception; nested exception is java.sql.SQLException: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.5.jar:2.5.5]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_79]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) [spring-context-2.5.5.jar:2.5.5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) [spring-context-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) [spring-web-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) [spring-web-2.5.5.jar:2.5.5]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) [spring-web-2.5.5.jar:2.5.5]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_79]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataService' defined in class path resource [rest_3/servicebean.xml]: Cannot resolve reference to bean 'daoBean' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoBean' defined in class path resource [rest_3/servicebean.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [rest_3.DAO]: Constructor threw exception; nested exception is java.sql.SQLException: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.5.jar:2.5.5]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_79]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) [spring-beans-2.5.5.jar:2.5.5]
... 31 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoBean' defined in class path resource [rest_3/servicebean.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [rest_3.DAO]: Constructor threw exception; nested exception is java.sql.SQLException: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.5.jar:2.5.5]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_79]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) [spring-beans-2.5.5.jar:2.5.5]
... 46 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [rest_3.DAO]: Constructor threw exception; nested exception is java.sql.SQLException: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) [spring-beans-2.5.5.jar:2.5.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) [spring-beans-2.5.5.jar:2.5.5]
... 57 more
Caused by: java.sql.SQLException: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) [derby-10.12.1.1.jar:]
at rest_3.DAO.load(DAO.java:25) [classes:]
at rest_3.DAO.<init>(DAO.java:15) [classes:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_79]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_79]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_79]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_79]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) [spring-beans-2.5.5.jar:2.5.5]
... 59 more
Caused by: ERROR X0Y32: Table/View 'LOCATION' already exists in Schema 'APP'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.execute.CreateTableConstantAction.executeConstantAction(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) [derby-10.12.1.1.jar:]
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) [derby-10.12.1.1.jar:]
... 69 more
16:28:05,938 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 47) JBWEB001103: Error detected during context /rest_3 start, will stop it
16:28:05,938 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/rest_3]] (ServerService Thread Pool -- 47) Closing Spring root WebApplicationContext
16:28:05,938 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 47) MSC000001: Failed to start service jboss.web.deployment.default-host./rest_3: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./rest_3: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Falló iniciar contexto
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_79]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Falló iniciar contexto
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
... 6 more
您是第一次調用REST服務還是僅在下一次調用時出現此錯誤? – aribeiro
它顯示我每次啓動部署了該服務的JBoss。 – Kelper
是什麼讓你覺得這個表不存在?這個例外非常清楚地表明:「表格/視圖'LOCATION'已經存在於模式'APP'中。」你只需要創建表格一次;在此之後,表格會一直存在,直到您「DROP TABLE」或銷燬整個數據庫。 –