zoukankan      html  css  js  c++  java
  • java -cp 执行class

    java命令执行某个类时,因为用到了一些依赖包,所以需要把lib以及classes中的内容导入。

    Java -cp lib/*:webapps/ROOT/WEB-INF/lib/*:webapps/ROOT/WEB-INF/classes com.govoid.task.admin.OrderPriceExportTask

    异常如下

    Exception in thread "main" java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCa

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapa

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegi

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListabl

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractAppli

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)

    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.jav

    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.jav

    at com.govoid.task.admin.OrderPriceExportTask.init(OrderPriceExportTask.java:53)

    at com.govoid.task.admin.OrderPriceExportTask.main(OrderPriceExportTask.java:46)

    后经提醒,是用到的内存不够,在jvm调整参数之后,问题解决

    java -server -Xms612m -Xmx612m -Xss612k -XX:PermSize=612m -XX:MaxPermSize=612m -cp lib/*:webapps/ROOT/WEB-INF/lib/*:webapps/ROOT/WEB-INF/classes com.govoid.task.admin.OrderPriceExportTask

  • 相关阅读:
    Python Data Analysis Library¶
    matadon/mizuno
    MySQL 5.1参考手册
    Apache Derby: Quick Start
    JRuby大捷:ThoughtWorks宣布Mingle发布在即
    RailsWithH2InJNDIOnJetty
    Embedded Jetty and Spring: The Lightweight Antidote for Java EE Complexity
    window下安装解压缩版mysql/zip压缩文件包非install安装程序
    Chapter 9. Extending Workbench
    Mysql手动增加一列_Blog of Grow_百度空间
  • 原文地址:https://www.cnblogs.com/govoid/p/4980731.html
Copyright © 2011-2022 走看看