我有一个具有JMS功能的项目,该项目将部署在tomcat中。
以下是我的 pom.xml 。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.package.cm</groupId>
<artifactId>ServiceClientSrc</artifactId>
<version>1.0</version>
</parent>
<artifactId>ServiceIngestionWAR</artifactId>
<packaging>war</packaging>
<name>ServiceIngestionWAR</name>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<activemq.version>5.9.0</activemq.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<artifact>org.apache.activemq:activemq-all:jar:${activemq.version}</artifact>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient -->
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.0.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
在部署时,我遇到了以下异常:
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans 异常处理全球JNDI资源 javax.naming.NamingException:无法加载资源工厂类 [根异常是java.lang.ClassNotFoundException: org.apache.activemq.jndi.JNDIReferenceFactory]
从几个建议中检查到,activemq jar是我所需要的。也添加了。但仍然会遇到此错误。
出了什么问题?请指导。