关于ActiveMQ的学习

原创 2013年12月03日 10:58:34

一、安装ActiveMQ

下载ActiveMQ

下载地址:http://activemq.apache.org/download.html

我用的是apache-activemq-5.9.0-bin.zip

解压apache-activemq-5.9.0-bin.zip

进入bin目录

我用的是win7 64位系统


如果直接运行bin目录下的activemq.bat文件会闪退

然后我进入win64目录运行activemq.bat

这时不会出现闪退,但是运行有错误  提示JAVA_HOME没有设置

然后这时需要在环境变量中配置JAVA_HOME

设置完环境变量之后运行还是报错  提示:wrapper  | Critical error: wait for JVM process failed


在网上找了半天也没解决问题,最后发现不能运行win64目录里面的activemq.bat

然后我运行win32目录里的activemq.bat终于启动了




另外安装ActiveMQ时还应注意以下问题:

一、在官网上下载ActiveMQ解压之后设置ActiveMQ环境变量

二、注意ActiveMQ的安装路径不能有空格
“F:\Program Files\apache-activemq-5.10.0”
像这种路径启动ActiveMQ的时候就会有问题,提示:找不到或无法加载


关于Maven构建Spring3.1 MVC + Hibernate4.1 + ActiveMQ整合的问题

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <springversion>3.1.1.RELEASE</springversion>
    <junitversion>3.8.1</junitversion>
  </properties>
  <dependencies>
    <!-- junit start -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <!-- junit end -->
    <!-- jstl start -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <version>1.1.2</version>
    </dependency>
    <!-- jstl end -->
    <!-- spring 3.1 mvc start -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-asm</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aspects</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-oxm</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${springversion}</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.1</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
	  <groupId>org.jasypt</groupId>
	  <artifactId>jasypt</artifactId>
	  <version>1.7.1</version>
    </dependency>
    <dependency>
	  <groupId>org.codehaus.jackson</groupId>
	  <artifactId>jackson-core-asl</artifactId>
	  <version>1.9.13</version>
    </dependency>
    <dependency>
	  <groupId>org.codehaus.jackson</groupId>
	  <artifactId>jackson-jaxrs</artifactId>
	  <version>1.9.13</version>
    </dependency>
    <dependency>
	  <groupId>org.codehaus.jackson</groupId>
	  <artifactId>jackson-mapper-asl</artifactId>
	  <version>1.9.13</version>
    </dependency>
    <!-- Spring 3.1 mvc end -->
    
    <!-- hibernate 4.1 start -->
    <dependency>
	  <groupId>org.hibernate</groupId>
	  <artifactId>hibernate-entitymanager</artifactId>
	  <version>4.1.0.Final</version>
    </dependency>
    <dependency>
	  <groupId>org.hibernate</groupId>
	  <artifactId>hibernate-core</artifactId>
	  <version>4.1.2</version>
	</dependency>
	<dependency>
	  <groupId>org.hibernate.javax.persistence</groupId>
	  <artifactId>hibernate-jpa-2.0-api</artifactId>
	  <version>1.0.1.Final</version>
	</dependency>
	<dependency>
	  <groupId>org.hibernate</groupId>
	  <artifactId>hibernate-ehcache</artifactId>
	  <version>4.1.2</version>
	</dependency>
	<dependency>
	  <groupId>org.hibernate.common</groupId>
	  <artifactId>hibernate-commons-annotations</artifactId>
	  <version>4.0.0.CR2</version>
	</dependency>
	<dependency>
	  <groupId>c3p0</groupId>
	  <artifactId>c3p0</artifactId>
	  <version>0.9.1.2</version>
    </dependency>
    <dependency> 
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.18</version>
    </dependency>
	<!-- hibernate 4.1 end -->
	
	<!-- log4j start -->
	<dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.15</version>
      <!-- 添加一下节点避免maven不兼容 -->
      <exclusions>
        <exclusion>
          <groupId>com.sun.jmx</groupId>
          <artifactId>jmxri</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jdmk</groupId>
          <artifactId>jmxtools</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.jms</groupId>
          <artifactId>jms</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
	<!-- log4j end -->
    
    <!-- solrj start -->
	<dependency>
	  <groupId>org.apache.solr</groupId>
	  <artifactId>solr-solrj</artifactId>
	  <version>4.9.0</version>
    </dependency>
	<!-- solrj end -->
	
	<!-- apache-poi start -->
	<dependency>
	  <groupId>org.apache.poi</groupId>
	  <artifactId>poi</artifactId>
	  <version>3.7</version>
    </dependency>
    <dependency>
	  <groupId>org.apache.poi</groupId>
	  <artifactId>poi-scratchpad</artifactId>
	  <version>3.7</version>
    </dependency>
    <!-- apache-poi end -->
    
    <!-- org.apache.ant start -->
    <dependency>
	  <groupId>org.apache.ant</groupId>
	  <artifactId>ant</artifactId>
	  <version>1.9.4</version>
    </dependency>
    <!-- org.apache.ant end -->
    
    <!-- fileupload start -->
    <dependency>
	  <groupId>commons-fileupload</groupId>
	  <artifactId>commons-fileupload</artifactId>
	  <version>1.3.1</version>
    </dependency>
    <dependency>
	  <groupId>commons-io</groupId>
	  <artifactId>commons-io</artifactId>
	  <version>2.4</version>
    </dependency>
    <!-- fileupload end -->
    
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>jsr250-api</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
      <version>5.7.0</version>
    </dependency>
  </dependencies>

之前我构建好Spring + Hibernate之后程序正常运行
但是当我加入ActiveMQ时发现项目报错
我打开Java Build Path发现这两个jar有问题

然后我去Maven本地仓库查看,发现这两个jar包没有下载下来
http://mvnrepository.com/然后我从mvnrepository上把这两个包下载下来之后加入本地仓库
好了项目没报错了,但是pom.xml文件里面报错,后来在网上找了下解决方案,在pom.xml中加入
<repositories>
    <repository>
        <id>java</id>
        <url>http://download.java.net/maven/2/</url>
        <releases>
           <enabled>true</enabled>
        </releases>
        <snapshots>
          <enabled>false</enabled>
        </snapshots>        
     </repository>
  </repositories>
ok ,问题解决  项目没问题了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

activemq在windows下启动报错,闪退问题

activemq在windows下启动报错,闪退问题,计算机名称引起报错。

ActiveMQ学习教程PPT

  • 2016-04-07 14:13
  • 1.80MB
  • 下载

ActiveMQ学习文档

  • 2012-04-19 10:54
  • 221KB
  • 下载

JMS学习二(简单的ActiveMQ实例)

前一篇文章我们整体上学习了JMS,这篇文章我们来写写小demo实践一下 在写之前我们要下载安装ActiveMQ服务,下载地址当然可以去官网下载,但我下载下来的有Linux 和win两个版本但是win的...

ActiveMQ学习 完整例子

  • 2014-12-29 16:21
  • 5.55MB
  • 下载

(一)ActiveMQ学习教程——安装(和topic实例)

背景:ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。 选择ActiveMQ作为JMS的入门学习中间件,是因为其拥有以下优点 1.多种语言和协议编写客户端。语言: ...

activeMQ_JMS学习资料

  • 2012-10-14 15:19
  • 340KB
  • 下载

ActiveMQ学习资料教程

  • 2014-03-21 11:01
  • 286KB
  • 下载

ActiveMQ学习

1.JMS介绍      JMS源于企业应用对于消息中间件的需求,使应用程序可以通过消息进行异步处理而互不影响。Sun公司和它的合作伙伴设计的JMS API定义了一组公共的应用程序接口和相应语法,使...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)