Oracle Firstcup教程(第一次战争)

时间:2014-04-21 19:41:13

标签: java-ee

我是Java ee的新手。我从oracle java ee页面获得了一个教程firstcup。我按照dukes-age的教程进行操作,效果很好。 第一次战争的教程似乎不在我的系统上运行。

我正在使用Netbeans 8.0,GlassFish 4.0和Windows 7操作系统。

1。我按照提供的说明操作,当我运行项目时     我收到的第一条消息是添加了一个我没看到的服务器     教程(firstcup-war)。

2。在添加glassfish服务器后,项目仍然没有部署在     服务器,我从glassfish得到了这个警告和例外     服务器:

2.1

Warning:   RAR5038:Unexpected exception while creating resource for pool DerbyPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
Warning:   RAR5117 : Failed to obtain/create connection from connection pool [ DerbyPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
Warning:   RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.]
Severe:   Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
Error Code: 0
  at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:316)
  at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)
.....

and chain of other exception that caused the above execption.

2.2

Severe:   Exception while deploying the app [firstcup-war]
Severe:   Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
.....

3。

在运行(firstcup-war)输出页面上,我在显示构建成功的日志后收到此消息:

------------------------------------------------------------------------
Total time: 7.949s
Finished at: Mon Apr 21 17:05:54 WAT 2014
Final Memory: 9M/111M
------------------------------------------------------------------------
NetBeans: Deploying on GlassFish Server
    profile mode: false
    debug mode: false
    force redeploy: true
In-place deployment at C:\Users\NYE\Documents\NetBeansProjects\java ee\firstcup-war\target\firstcup-war-1.0-SNAPSHOT
GlassFish Server, deploy, null, false

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

在教程中,maven只创建一个war文件。您必须使用glassfish控制台将其部署到glassfish服务器。

http://localhost:4848

此外,您还必须启动Java数据库。

asadmin start-database