创建ConnectionFactory 提示Cannot resoulve symbol ‘ConnectionFactory ’如何处理
主程序
package com.imooc.jms.queue;
import javax.jms.*;
import javax.jms.*;
import org.apache.activemq.ActiveMQConnectionFactory;
public class AppProduces {
private static final String url="localhost:61616";
private static final String queueName="queue-test";
public static void main(String[] args ){
//1、创建ConnectionFactory
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
//2、创建connection
// Connection connection=connectionFactory.create
}
}
pom 文件
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>imooc_ActiveMQ</groupId>
<artifactId>imooc_ActiveMQ</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>3.4.1</version>
</dependency>
</dependencies>
</project>
环境:
jdk:1.8.0-121
开发工具;idea 2017.1.4