Activemq5.13.2异常

我的系统是win8.1(64位的)下面是我用命令行打开bin\win64\activemq.bat时的报错,

wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | Java Runtime: Oracle Corporation 1.7.0_17 C:\Program Files\Java\jre7
jvm 1    |   Heap sizes: current=15872k  free=11553k  max=1013632k
jvm 1    |     JVM args: -Dactivemq.home=../.. -Dactivemq.base=../.. -Djavax.net
.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=password -Djav
ax.net.ssl.keyStore=../../conf/broker.ks -Djavax.net.ssl.trustStore=../../conf/b
roker.ts -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRu
nner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.conf=../
../conf -Dactivemq.data=../../data -Djava.security.auth.login.config=../../conf/
login.config -Xmx1024m -Djava.library.path=../../bin/win32 -Dwrapper.key=jW9ZpPT
P06mL7EMf -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.m
ax=31999 -Dwrapper.pid=5044 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wra
pper -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1
jvm 1    | Extensions classpath:
jvm 1    |   [..\..\lib,..\..\lib\camel,..\..\lib\optional,..\..\lib\web,..\..\l
ib\extra]
jvm 1    | ACTIVEMQ_HOME: ..\..
jvm 1    | ACTIVEMQ_BASE: ..\..
jvm 1    | ACTIVEMQ_CONF: ..\..\conf
jvm 1    | ACTIVEMQ_DATA: ..\..\data
jvm 1    | Loading message broker from: xbean:activemq.xml
jvm 1    |  INFO | Refreshing [email protected]
9377: startup date [Fri Jun 26 11:32:02 CST 2015]; root of context hierarchy
jvm 1    |  INFO | PListStore:[E:\Tendyron工作备份\IM\apache-activemq-5.10.2-bin
\apache-activemq-5.10.2\bin\win32\..\..\data\localhost\tmp_storage] started
jvm 1    |  INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[E:\Tendyr
on工作备份\IM\apache-activemq-5.10.2-bin\apache-activemq-5.10.2\bin\win32\..\..data\kahadb]
jvm 1    |  INFO | KahaDB is version 5
jvm 1    |  INFO | Recovering from the journal ...
jvm 1    |  INFO | Recovery replayed 1 operations from the journal in 0.024 seco
nds.
jvm 1    |  INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is starting
jvm 1    | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:PCbqcui-55122
-1435289524042-0:1], java.io.IOException: Transport Connector could not be regis
tered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnec
tions=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Add
ress already in use: JVM_Bind)
jvm 1    |  INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is shutting down
jvm 1    |  INFO | Connector openwire stopped
jvm 1    |  INFO | Connector amqp stopped
jvm 1    |  INFO | Connector stomp stopped
jvm 1    |  INFO | Connector mqtt stopped
jvm 1    |  INFO | Connector ws stopped
jvm 1    |  INFO | PListStore:[E:\Tendyron工作备份\IM\apache-activemq-5.10.2-bin
\apache-activemq-5.10.2\bin\win32\..\..\data\localhost\tmp_storage] stopped
jvm 1    |  INFO | Stopping async queue tasks
jvm 1    |  INFO | Stopping async topic tasks
jvm 1    |  INFO | Stopped KahaDB
jvm 1    |  INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) uptime 1.284 seconds
jvm 1    |  INFO | Apache ActiveMQ 5.10.2 (localhost, ID:PCbqcui-55122-143528952
4042-0:1) is shutdown
jvm 1    |  INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@19f937
7: startup date [Fri Jun 26 11:32:02 CST 2015]; root of context hierarchy
jvm 1    |  WARN | Exception thrown from LifecycleProcessor on context close
jvm 1    | java.lang.IllegalStateException: LifecycleProcessor not initialized -
 call ‘refresh‘ before invoking lifecycle methods via the context: org.apache.ac
tivemq.xbean.XBeanBrokerFactory$1@19f9377: startup date [Fri Jun 26 11:32:02 CST
 2015]; root of context hierarchy
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.getLifecycleProcessor(AbstractApplicationContext.java:360)[spring-context-3.2.
8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.doClose(AbstractApplicationContext.java:1057)[spring-context-3.2.8.RELEASE.jar
:3.2.8.RELEASE]
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.close(AbstractApplicationContext.java:1010)[spring-context-3.2.8.RELEASE.jar:3
.2.8.RELEASE]
jvm 1    |      at org.apache.activemq.hooks.SpringContextHook.run(SpringContext
Hook.java:30)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.broker.BrokerService.stop(BrokerService.j
ava:809)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBroker
Service.java:122)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.broker.BrokerService.start(BrokerService.
java:601)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesS
et(XBeanBrokerService.java:73)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1    |      at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1
638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[
spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spr
ing-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring
-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-b
eans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.
RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.DefaultSingletonBea
nRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8
.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractBeanFactory
.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RE
LEASE]
jvm 1    |      at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELE
ASE]
jvm 1    |      at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-bea
ns-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-co
ntext-3.2.8.RELEASE.jar:3.2.8.RELEASE]
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:
3.2.8.RELEASE]
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)[activemq-spring-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)[activemq-broker-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)[activemq-console-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)[activemq-console-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)[activemq-console-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)[activemq-console-5.10.2.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)[activemq-console-5.10.2.jar:5.10.2]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1    |      at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[
activemq.jar:5.10.2]
jvm 1    |      at org.apache.activemq.console.Main.main(Main.java:115)[activemq
.jar:5.10.2]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.7.0_17]
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:
1.7.0_17]
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)[:1.7.0_17]
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)[:1.7.0_17]
jvm 1    |      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)[wrapper.jar:3.2.3]
jvm 1    |      at java.lang.Thread.run(Unknown Source)[:1.7.0_17]
jvm 1    | ERROR: java.lang.RuntimeException: Failed to execute start task. Reas
on: java.lang.IllegalStateException: BeanFactory not initialized or already clos
ed - call ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1    | java.lang.RuntimeException: Failed to execute start task. Reason: jav
a.lang.IllegalStateException: BeanFactory not initialized or already closed - ca
ll ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1    |      at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:91)
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
jvm 1    |      at org.apache.activemq.console.Main.main(Main.java:115)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | Caused by: java.lang.IllegalStateException: BeanFactory not initializ
ed or already closed - call ‘refresh‘ before accessing beans via the Application
Context
jvm 1    |      at org.springframework.context.support.AbstractRefreshableApplic
ationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.destroyBeans(AbstractApplicationContext.java:1090)
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:487)
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)
jvm 1    |      at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)
jvm 1    |      ... 16 more
jvm 1    | ERROR: java.lang.IllegalStateException: BeanFactory not initialized o
r already closed - call ‘refresh‘ before accessing beans via the ApplicationCont
ext
jvm 1    | java.lang.IllegalStateException: BeanFactory not initialized or alrea
dy closed - call ‘refresh‘ before accessing beans via the ApplicationContext
jvm 1    |      at org.springframework.context.support.AbstractRefreshableApplic
ationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.destroyBeans(AbstractApplicationContext.java:1090)
jvm 1    |      at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:487)
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:64)
jvm 1    |      at org.apache.xbean.spring.context.ResourceXmlApplicationContext
.(ResourceXmlApplicationContext.java:52)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBr
okerFactory.java:104)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicatio
nContext(XBeanBrokerFactory.java:104)
jvm 1    |      at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBe
anBrokerFactory.java:67)
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:71)
jvm 1    |      at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerF
actory.java:54)
jvm 1    |      at org.apache.activemq.console.command.StartCommand.runTask(Star
tCommand.java:87)
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.runTask(Shel
lCommand.java:150)
jvm 1    |      at org.apache.activemq.console.command.AbstractCommand.execute(A
bstractCommand.java:57)
jvm 1    |      at org.apache.activemq.console.command.ShellCommand.main(ShellCo
mmand.java:104)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
jvm 1    |      at org.apache.activemq.console.Main.main(Main.java:115)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:240)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
wrapper  | <-- Wrapper Stopped

在网上早了好多的解决办法,但都不行,我这个是5.13.2的,网上基本5.10的比较多,照着网上的办法,又是改计算机名——不能有中间横杆,又是改activemq.xml的,我试了试,还是不能正常启动。试了好久后,又觉得是jdk的路径名有问题,因为我一开始是D:\jdk1.8.0_40(这个是JAVA_HOME的)(PS网上说,要在环境变量的系统变量里设置CLASS_PATH、JAVA_HOME、path这些可以百度查)后来,我把jdk的名字改为jdk1.8.0.40,同时也把环境变量里的xx的用户变量和下面的系统变量里面有关jdk路径的设置的都改到D:\jdk1.8.0.40\(这只是JAVA_HOME的,其他的也就是吧jdk的名字改了),接着要重启下才行。

后来,再运行命令行,它就报了错:...java.lang.IllegalStateException: BeanFactory not initialized or already closed ...看着是Bean没启动。最后,我就试试看,把jdk改为用jdk1.7.0.21的,同上把环境变量里的也做了更改,再重启下,然后我运行了命令行win64\activemq.bat;魂淡,它居然就成功了…..最后的结果是这样的

总结,activemq5.13.2配的jdk应该用的是jdk1.7的,我做的更改,就是把计算机的名字改为纯英文的(没有中间横杆),jdk文件夹的名字也没有下划线或其他字符,环境变量里的系统变量里增加了下面几项:

CLASS_PATH:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar

JAVA_HOME:D:\jdk1.7.0.21\

Path:D:\jdk1.7.0.21\bin(如果原来还在系统变量加path的,记得补上 “;C:\Windows\System32”,不然查不了ipconfig的)

哥能做的只有这么多了,原来有预想弄activemq可能网上解决文档难找,没想到这么稀缺,找了好久一堆雷同,就是没卵用。在此添上一点解决办法,希望有用。

时间: 2024-10-17 06:26:45

Activemq5.13.2异常的相关文章

Struts2-学习笔记系列(13)-类型转换异常和校验器

Struts2框架有默认的类型转换错误拦截机制,该配置在struts-default.xml中,名叫conversionError,但是想使用需要继承ActionSupport. 默认的错误提示信息是英语的,若是想自定义,需要修改国际化文件: mess.properties: xwork.default.invalid.fieldvalue={0}字段类型转换失败! 对于对象的字段进行提示的话,需要使用局部action属性文件,并制定对应的字段名称 invalid.fieldvalue.user

消息中间件activemq-5.13.0整合spring

首先说明这里是在qctivemq配置好并启动服务的情况下进行,请先自行配置好.也可关注我的博文(消息中间件qctivemq安全验证配置)进行配置. 1.首先看一下项目结构 2.所需jar包,这里只列出mq相关jar包,spring相关不与说明. 3.消息生产service  QueueMessageProducer package cn.carowl.activemq; import javax.jms.Destination; import javax.jms.JMSException; im

ActiveMQ-5.13.0集群

ActiveMQ集群介绍 ActiveMQ具有强大和灵活的集群功能,但在使用的过程中会发现很多的缺点,ActiveMQ的集群方式主要由两种:Master-Slave(ActiveMQ5.8版本已不可用)和Broker Cluster. Broker集群 一个常见的场景是有多个 JMS broker ,有一个客户连接到其中一个 broker .如果这个 broker 失效,那么客户会自动重新连接到其它的 broker .在 ActiveMQ 中使用 failover:// 协议来实现这个功能.如果

消息中间件activemq-5.13.0安全验证配置

activemq分为控制端和客户端,下面分别介绍安全认证配置方法. 1.控制端安全配置 (1). ActiveMQ目录conf下找到jetty.xml: <bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint"> <property name="name" value="BASIC" /> <p

java 19 - 6 throws的方式处理异常

1 /* 2 有些时候,我们是可以对异常进行处理的,但是又有些时候,我们根本就没有权限去处理某个异常. 3 或者说,我处理不了,我就不处理了. 4 为了解决出错问题,Java针对这种情况,就提供了另一种处理方案:抛出. 5 6 格式: 7 throws 异常类名1,异常类名2,... 8 注意:这个格式必须跟在方法的括号后面. 9 10 注意: 11 尽量不要在main方法上抛出异常. 12 但是我讲课为了方便我就这样做了. 13 (后面异常会跳转到页面中) 14 15 小结: 16 编译期异常

Atitit.异常的设计原理与&#160;策略处理&#160;java&#160;最佳实践&#160;p93

Atitit.异常的设计原理与 策略处理 java 最佳实践 p93 1 异常方面的使用准则,答案是::2 1.1 普通项目优先使用异常取代返回值,如果开发类库方面的项目,最好异常机制与返回值都提供,由调用者决定使用哪种方式..2 1.2 优先把异常抛出到上层处理..异常本身就是为了方便把异常情况抛出到上层处理..2 1.3 对于 HYPERLINK \l _Toc6222 方法调用结果异常情况返回策略,最终会有四种策略状况,2 1.4 返回null  还是异常??2 2 异常的由来与设计3 2

J2EE开发工作中遇到的异常问题及解决方法总结

转自:http://blog.csdn.net/rchm8519/article/details/41624381 1.    HttpClient I/O exception: 错误信息:I/O exceptioncaught when processing request: Connection timed out:connect 错误原因:IP不正确. 解决方法:改正IP 2.    Ambiguous handler methods mapped 错误信息:java.lang.Illeg

java Scanner和异常

Java Scanner 类 java.util.Scanner 是 Java5 的新特征,我们可以通过 Scanner 类来获取用户的输入. 下面是创建 Scanner 对象的基本语法: Scanner s = new Scanner(System.in); 接下来我们演示一个最简单的的数据输入,并通过 Scanner 类的 next() 与 nextLine() 方法获取输入的字符串,在读取前我们一般需要 使用 hasNext 与 hasNextLine 判断是否还有输入的数据: 使用 ne

转:delphi异常捕获try except语句 和 try finally语句用法

转:http://www.java123.net/v/936977.html      2015-06-24 09:27:48 一直写程序都没管他们,也尽量很少用,今天终于想把他给弄个明白,在网上找来,记下!主要是前面小部分,后面的是详细说明(很啰嗦!) 一.异常的来源 在Delphi的应用程序中,下列的情况都比较有可能产生异常. (1)文件处理 (2)内存分配 (3)Windows资源 (4)运行时创建对象和窗体 (5)硬件和操作系统冲突 二.异常的处理 (1)try…except…end;