“修复你的应用程序”在部署战争时警告来自glassfish

时间:2012-02-27 11:27:26

标签: java eclipse jax-ws glassfish-3

我从glassfish(3.1)中得到了这个恼人的警告和基本错误:

"http://localhost:4848/management/domain/applications/application/websrvice-test-1.0" created successfully. WARNING: Command _deploy did not complete successfully on server instance TodoAppWBConnection: remote failure: Failed to load the application on instance TodoAppWBConnection. The application will not run properly. Please fix your application and redeploy.

重复两次......

这是我今天添加的代码,昨天.war部署进展顺利,今天我添加了这段代码,现在它出错了。

@WebMethod
public @WebResult(name="TaskUpdated")boolean updateTaskWithId(@WebParam(name="Username")String username,@WebParam(name="Id")String id,@WebParam(name="category")String category,@WebParam(name="completion_dtm")Date completion_dtm,@WebParam(name="desc")String desc,@WebParam(name="duedate")Date duedate,@WebParam(name="notification_duedate")String notification_duedate,@WebParam(name="notification_one")String notification_one,@WebParam(name="notification_two")String notification_two,@WebParam(name="priority")int priority,@WebParam(name="reminder_one")Date reminder_one,@WebParam(name="reminder_two")Date reminder_two,@WebParam(name="title")String title,@WebParam(name="timestamp")Date timestamp)
{
    //String sql = "REPLACE INTO tasks VALUES('" + category + "','" + completion_dtm + "','" + desc + "','" + duedate + "','" + notification_duedate + "','" + notification_one + "','" + notification_two + "'," + priority + ",'" + reminder_one + "','" + reminder_two + "','" + timestamp + "','" + title + "','" + username + "','" + id + "')";
    String sql = "UPDATE tasks VALUES('" + category + "','" + completion_dtm + "','" + desc + "','" + duedate + "','" + notification_duedate + "','" + notification_one + "','" + notification_two + "'," + priority + ",'" + reminder_one + "','" + reminder_two + "','" + timestamp + "','" + title + "','" + username + "','" + id + "') WHERE id = '"+ id + "'";
    Connection connection = getConnection();
    PreparedStatement ps;
    try 
    {
        ps = connection.prepareStatement(sql);
        ps.executeUpdate();
        return true;
    }
    catch(Exception preperationError)
    {
        //System.out.println(preperationError);
        return false;
    }
    finally
    {
        closeConnection(connection);
    }
}

我正在使用带有Maven插件的eclipse,我清理我的项目并安装它以生成war文件。然后将它部署在我在glassfish中制作的独立实例上。昨天它工作正常,直到我添加了上面的代码。有帮助吗?提前致谢。告诉我是否应该发布更多信息。

再次,谢谢!

编辑:有一些疯狂的文字,不能超过这一切,但它们基本上都是以

开头的
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.glassfish.webservices.WSServletContextListener at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:921) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901) at 

EDIT2:

288 SEVERE  Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: or... (details)   javax.enterprise.system.tools.admin.org.glassfish.deployment.admin  Feb 27, 2012 14:20:19.179   _ThreadID=19;_ThreadName=Thread-4;
287 SEVERE  Exception while loading the app(details)    javax.enterprise.system.core.com.sun.enterprise.v3.server   Feb 27, 2012 14:20:19.166   _ThreadID=19;_ThreadName=Thread-4;
286 SEVERE  Exception while invoking class com.sun.enterprise.web.WebApplication start method java.lang.Exceptio... (details)   javax.enterprise.system.tools.admin.org.glassfish.deployment.admin  Feb 27, 2012 14:20:19.148   _ThreadID=19;_ThreadName=Thread-4;
285 WARNING java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleExcepti... (details)   javax.enterprise.system.container.web.com.sun.enterprise.web    Feb 27, 2012 14:20:19.148   _ThreadID=19;_ThreadName=Thread-4;
284 SEVERE  ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentExc... (details)    org.apache.catalina.core.ContainerBase  Feb 27, 2012 14:20:19.145   _ThreadID=19;_ThreadName=Thread-4;
283 INFO    WS-TX Services successfully started.(details)

EDIT3: 尝试在更新工具中安装了不同更新的不同端口安装gf 3.0.1,它会成功部署,但它不会生成WSDL链接或文件,但我还是无法使用它...

EDIT4: 将gf从3.0.1更新到3.1(官方)打破了它,进行了手动卸载并重新安装。

2 个答案:

答案 0 :(得分:1)

发现问题。我使用的是java.sql.Date,其中glassfish不理解,现在我需要格式化任何字符串,就像它会是一个约会,更多的工作!

答案 1 :(得分:1)

当没有与SQL Server db的数据库连接时,我遇到了同样的错误。我创建了一个连接池和JNDI引用,并且能够成功部署。 错误消息极具误导性。我的网络服务器是glassfish 3.1