war

PayaraMicro does not call @PreDestroy on EJB or ApplicationScoped

ぐ巨炮叔叔 提交于 2020-05-31 05:44:06
问题 I'm migrating a WAR application from PayaraServer to Payara Micro to reduce RAM usage. I just realise that @PreDestroy on EJBs are not called when stopping the instance with CTRL+C. Is there a correct way to close the payaramicro instance properly as I'd like to execute some operations. Thanks for your answers! Or which services in Payara Server to deactivate to use as much as RAM as PayaraMicro? I'm using the version 5.183, and I also tried the 5.192. 回答1: Which kind of EJB did you use? In

PayaraMicro does not call @PreDestroy on EJB or ApplicationScoped

怎甘沉沦 提交于 2020-05-31 05:43:28
问题 I'm migrating a WAR application from PayaraServer to Payara Micro to reduce RAM usage. I just realise that @PreDestroy on EJBs are not called when stopping the instance with CTRL+C. Is there a correct way to close the payaramicro instance properly as I'd like to execute some operations. Thanks for your answers! Or which services in Payara Server to deactivate to use as much as RAM as PayaraMicro? I'm using the version 5.183, and I also tried the 5.192. 回答1: Which kind of EJB did you use? In

maven application with multi environment configuration can't deploy on tomcat

随声附和 提交于 2020-04-18 20:39:10
问题 I am trying to configure multi deployment environment for my web application using Spring Boot with Maven. Created several .properties files under src/main/resources/config. db-dev.properties and db-prod.properties consist of db specific information: db.url=jdbc:oracle:thin:@ldap://dev.com/risstg3, db.username=owner db.password=godzilla In the same directory I also have application.properties which reads in the variables defined in these db property files #database info spring.datasource

maven application with multi environment configuration can't deploy on tomcat

我怕爱的太早我们不能终老 提交于 2020-04-18 20:23:32
问题 I am trying to configure multi deployment environment for my web application using Spring Boot with Maven. Created several .properties files under src/main/resources/config. db-dev.properties and db-prod.properties consist of db specific information: db.url=jdbc:oracle:thin:@ldap://dev.com/risstg3, db.username=owner db.password=godzilla In the same directory I also have application.properties which reads in the variables defined in these db property files #database info spring.datasource

I'm getting ClassCastException: WrappedPreparedStatementJDK8 cannot be cast to SQLServerPreparedStatement

倖福魔咒の 提交于 2020-03-25 16:51:16
问题 My environment: Eclipse IDE for Enterprise Java Developers, Version: 2019-09 R (4.13.0) Server: WildFly 13.0.0.Final I'm trying to bulk upload the data to Sql Server and the code below works perfectly in my WildFly server with same version but fails in the client's server machine with same wildfly server with java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk8.WrappedPreparedStatementJDK8 cannot be cast to com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement in the statement

I'm getting ClassCastException: WrappedPreparedStatementJDK8 cannot be cast to SQLServerPreparedStatement

冷暖自知 提交于 2020-03-25 16:47:13
问题 My environment: Eclipse IDE for Enterprise Java Developers, Version: 2019-09 R (4.13.0) Server: WildFly 13.0.0.Final I'm trying to bulk upload the data to Sql Server and the code below works perfectly in my WildFly server with same version but fails in the client's server machine with same wildfly server with java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk8.WrappedPreparedStatementJDK8 cannot be cast to com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement in the statement

使用Spring Boot Gradle 打war包的一点心得体会

放肆的年华 提交于 2020-03-02 02:52:44
最近实验室的一些项目采用了Spring Boot架构进行开发。项目完成以后,就需要部署到服务器。常规办法就是将项目打成war包,直接拖到tomcat的webaaps下,但是Spring boot 的默认是将项目打成jar包,所以就需要进行一些配置。百度和Google了配置方法都是大同小异。 不过网上的例子大部分都是使用的是Eclipse+ Maven ,我们实验室使用的idea+gradle。所以就有一些小的变化,不过都是相通的。需要修改的地方是: Application中 这里继承SpringBootServletInitializer 并重写其中的configure方法目的是使用Spring框架的Servlet3.0支持。并且允许我们可以配置项目从serclet容器中启动。 在build.gradle里配置 主要是添加war包的支持,其次的话就是在spring-boot-starter-tomcat处改为provided。provided和compile的区别在与前者是在调试使用时会加载对应的包,但是 在打包时不会讲对应的包加入到war包的lib中而后者则是两种情况都要调用对应的包。 至此基本的配置都已经完成了。前面的工作的目的都是防止Spring Boot中内置的Tomcat 与实际的tomcat容器产生冲突。 这样的话一个常规的Spring Boot项目就可以直接打包部署

create temp files in tomcat webapps folder

筅森魡賤 提交于 2020-01-25 03:42:44
问题 I have a Google Web Project which works perfect on Development mode. Somewhere inside this project, I create some .xml files which I delete after parsing. When I deploy the .war file of my project in Tomcat7 (var/lib/tomcat7/webapps) (I use the tomcat manage to deploy it) the project fails to create any file. I've tried all possible paths inside the webapps folder. I even tried context.getRealPath("/")+"/ROOT/tmp/" but nothing happens 回答1: You should be using the temp folder instead of

How to add TXT file to the WAR archive using command-line in MS Windows

这一生的挚爱 提交于 2020-01-24 23:47:32
问题 I have key.txt file in E:/ drive and app.war file in C:/ drive. How to copy key.txt to the subfolder of the app.war file i.e WebContent/WEB-INF. Key should copy to the WEB-INF folder. I want result like(after unzipping war file) WebContent | |->META-INF |->WEB-INF | |->key.txt 回答1: Finally i got answer, for this i used. mkdir c:/WEB-INF cd WEB-INF xcopy D:/key.txt C:/WEB-INF jar uvf app.war /WEB-INF/key.txt No need of unzipping and again zipping. 回答2: You can use the jar command to extract

How to configure Maven multi module dependency on sub project with different packaging

雨燕双飞 提交于 2020-01-24 20:02:06
问题 I have 2 maven projects: one is a rest service with a WAR packaging (rest), the other one is a module to access database with a jar packaging (service). In the pom of the rest module I add the dependency with service as follows: <dependency> <groupId>project</groupId> <artifactId>service</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> However I'm getting this error: Project 'rest' is missing required library: 'C:\Users\user.m2\repository\project\service\0.0.1-SNAPSHOT\service-0.0