使用mod_jk和mod_proxy使用apache前端tomcat实例的优点和缺点是什么?
我已经在生产中使用mod_jk多年了,但我听说它是面向tomcat的"旧方式".我应该考虑改变吗?会有什么好处吗?
Eclipse使用它自己的编译器(ECJ)来编译Java代码.调试使用Eclipse编译的程序更容易,因为可以立即应用简单的代码更改(通过热代码替换).
另一方面,Maven使用(默认情况下)oracle JDK,它生成不同的字节代码,防止在Eclipse调试会话中替换热代码.
因此,如果我计划调试程序,我想将Eclipse ECJ编译器与我的maven构建一起使用.对我来说一个方便的方式是"ecj"配置文件:
编译发布
$ mvn package
Run Code Online (Sandbox Code Playgroud)使用已启用的热代码替换编译快照
$ mvn -P ecj package
Run Code Online (Sandbox Code Playgroud)此外,可以在settings.xmlEclipse项目属性中指定配置文件激活.
我的问题是:
我在项目中使用父 POM 和子 POM:
父 POM:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<executions>
<execution>
...
<configuration>
...
<xsdOptions>
<xsdOption>
<extensionArgs>
<extensionArg>-XNullable</extensionArg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
我在子 POM 中的目标是消除该<extensionArg>-XNullable</extensionArg>参数。
我尝试使用以下combine.self="override"属性:
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<configuration>
<xsdOptions>
<xsdOption>
<extensionArgs combine.self="override">
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
但这行不通。有效的配置仍然是:
<xsdOptions>
<xsdOption>
<extensionArgs combine.self="override">
<extensionArg>-XNullable</extensionArg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
</extensionArgs>
</xsdOption>
</xsdOptions>
Run Code Online (Sandbox Code Playgroud)
有什么想法如何<extensionArg>-XNullable</extensionArg>在 Maven 合并过程中从配置中删除吗?
Maven:3.3.3
我使用Groovy使用"EnvInject Plugin"插件将变量注入构建过程:
https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
我的脚本保存在"Evaluated Groovy script"文本区域下.
如果脚本正常工作,一切都很好.但是,如果发生某些错误,我总是得到相同的错误消息:
[EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: null
Run Code Online (Sandbox Code Playgroud)
有没有办法获得实际的异常甚至异常消息?
在我的Maven构建中,我用它maven-processor-plugin来生成这样的JPA元模型
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
....
</execution>
</plugin>
Run Code Online (Sandbox Code Playgroud)
现在我想跳过基于属性的元模型生成,就像这样
$ mvn -Dspeed.up.build.from.eclipse=true
Run Code Online (Sandbox Code Playgroud)
不幸的是,maven-processor-plugin它<skip>${speed.up.build.from.eclipse}</skip>不像某些插件那样支持配置标记.
我可以将我的插件放在配置文件中,然后根据我的属性激活它.但后来我需要以某种方式否定财产的价值......
所以我需要:
是否有一些很好的方法可以实现它?如果有,怎么样?
您好我在Tomcat 7服务器上创建了一个JNDI资源,我正在尝试通过persistence.xml使用它,但是我收到一个错误,即在上下文中找不到资源名称.我尝试在网上找到其他解决方案,但没有为我工作.有谁看到了什么问题?在我的server.xml片段下面:
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
<Resource name="jdbc/myds" auth="Container"
type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="10000"
username="boardgames" password="boardgames"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;databaseName=boardgames;integratedSecurity=true;"
/>
</GlobalNamingResources>
Run Code Online (Sandbox Code Playgroud)
我还在web.xml中添加了资源引用:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Run Code Online (Sandbox Code Playgroud)
persistence.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="persistence_sample" transaction-type="RESOURCE_LOCAL">
<!--
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-->
<non-jta-data-source>java:/comp/env/jdbc/myds</non-jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/> <!-- Enable Hibernate's automatic …Run Code Online (Sandbox Code Playgroud) 我在DECLARE..BEGIN..END;块中定义了几个本地函数/过程:
DECLARE
PROCEDURE a IS
BEGIN
...
END;
PROCEDURE b IS
BEGIN
...
END;
BEGIN
END;
Run Code Online (Sandbox Code Playgroud)
如何获得所有已定义函数/过程的列表?(在这个例子中:['a','b'])