Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5726EE6B1 for ; Mon, 31 Dec 2012 02:40:54 +0000 (UTC) Received: (qmail 47053 invoked by uid 500); 31 Dec 2012 02:40:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 46664 invoked by uid 500); 31 Dec 2012 02:40:53 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 46638 invoked by uid 99); 31 Dec 2012 02:40:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Dec 2012 02:40:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.215.44] (HELO mail-la0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Dec 2012 02:40:46 +0000 Received: by mail-la0-f44.google.com with SMTP id fr10so3341664lab.3 for ; Sun, 30 Dec 2012 18:40:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:x-gm-message-state; bh=hTxTC6naIpsiCe1TVKRC3A3gqW2vYyjxxnk/K9C1oEo=; b=M3iML62FL960NNrzYSwwmCscGGvmCgLa8lRu/blqm+QInE3XY3g9O9fMfIBSEP3Noc +gppY1qyY44hg+ryNywYi6/WhkX7suGA1SGagP3CodYA5yXgntPjvRGTgxzCgdCG4/Ta IhQR5gVVpDUVNJsggkoPF6Utvx+cnOIjRpwu14NPJAAxlCuYF9KqhHWi5vTZDX68r3d5 h+cXpr9ZrA7GsnwQJIGlqtQUzxnObEYud30n7LziuAEziJag3u5F6HLp1/bxXvgOlFdv ZosJEsEqNzEyxTr64CQEpqj+jG8A80YSPyhM34hLySABhMIHNLW8HdqJD975ewrWe2s4 xFJA== MIME-Version: 1.0 Received: by 10.152.148.129 with SMTP id ts1mr37894704lab.19.1356921624445; Sun, 30 Dec 2012 18:40:24 -0800 (PST) Received: by 10.114.78.196 with HTTP; Sun, 30 Dec 2012 18:40:24 -0800 (PST) In-Reply-To: <2F9B5BAC-1737-4304-BFF5-228E2A9DEEC3@gmail.com> References: <50E061A8.4090801@gmail.com> <2F9B5BAC-1737-4304-BFF5-228E2A9DEEC3@gmail.com> Date: Mon, 31 Dec 2012 15:40:24 +1300 Message-ID: Subject: Re: MalformedObjectNameException when starting camel context From: Liam Clarke-Hutchinson To: users@camel.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnyReVfzP/3ph9f6jGHPCCh/DPUlTBQ9HuVcBZrKr/DWi5bZp46pNoapsXi5hsqi/XlLUsg X-Virus-Checked: Checked by ClamAV on apache.org Hi Tim, It's trying to get an mbean or similar with a name derived from (I guess) your machine's IP - which is in IPV6, hence lots of colons. However, if you look at the documentation for ObjectName (http://docs.oracle.com/javase/1.5.0/docs/api/javax/management/ObjectName.h= tml) you'll see it states: > An ObjectName can be written as a String with the following elements in o= rder: > The domain. > A colon (:). > A key property list as defined below. And also >An unquoted value is a possibly empty string of characters which may not c= ontain any of the characters comma, equals, colon, quote, asterisk, or ques= tion mark. So it's hitting the first colon, starts interpreting the rest of the IP as a property, hits the next colon while parsing it as a property value, and blows up because colons aren't allowed. Looking at what DefaultManagementNamingStrategy.createObjectName does, it ultimately calls java.net.InetAddress#getLocalHost() to get that IP. Maybe you need to alias localhost in your /etc/hosts? Regards, Liam Clarke On Mon, Dec 31, 2012 at 2:38 PM, Willem Jiang wrot= e: > > Hi, > It looks something is wrong with you host name. Can you just change it? > > Willem > > > > =E5=9C=A8 2012-12-30=EF=BC=8C=E4=B8=8B=E5=8D=8811:45=EF=BC=8CTim Dudgeon = =E5=86=99=E9=81=93=EF=BC=9A > > > I'm seeing a strange error when starting a camel context. Its dependent= on the machine I'm running on. On one machine (Windows) the same context = and simple route runsfine, but on a different machine (Mac) the context fai= ls to start. The key part seems to be this: > > > > javax.management.MalformedObjectNameException: Could not create ObjectN= ame from: org.apache.camel:context=3Dunknown-00:25:4b:c4:94:f4.home/camel-1= ,type=3Dcontext,name=3D"camel-1". Reason: javax.management.MalformedObjectN= ameException: Invalid character ':' in value part of property > > > > The context and route is very simple: > > > > def camelContext =3D new DefaultCamelContext() > > camelContext.addRoutes(new RouteBuilder() { > > def void configure() { > > from("timer://jdkTimer?period=3D3000") > > .to("log://camelLogger?level=3DINFO") > > } > > }) > > > > This is using Camel 2.10.3. > > Any ideas what might be going wrong? > > > > The full error is here: > > > > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/ja= va -Dtools.jar=3D/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Content= s/Home/lib/tools.jar -Dgroovy.home=3D/Users/timbo/etc/groovy/groovy-1.8.8 -= Dgroovy.starter.conf=3D/Users/timbo/etc/groovy/groovy-1.8.8/conf/groovy-sta= rter.conf -Didea.launcher.port=3D7532 "-Didea.launcher.bin.path=3D/Applicat= ions/IntelliJ IDEA 11 CE.app/bin" -Dfile.encoding=3DUTF-8 -classpath "/User= s/timbo/etc/groovy/groovy-1.8.8/lib/groovy-1.8.8.jar:/Applications/IntelliJ= IDEA 11 CE.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppM= ain org.codehaus.groovy.tools.GroovyStarter --conf /Users/timbo/etc/groovy/= groovy-1.8.8/conf/groovy-starter.conf --main groovy.ui.GroovyMain --classpa= th /Users/timbo/tmp/TestingCamel/out/production/TestingCamel:/Users/timbo/e= tc/groovy/groovy-1.8.8/lib/ant-1.8.3.jar:/Users/timbo/etc/groovy/groovy-1.8= .8/lib/ant-antlr-1.8.3.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/ant-jun= it-1.8.3.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/ant-launcher-1.8.3.ja= r:/Users/timbo/etc/groovy/groovy-1.8.8/lib/antlr-2.7.7.jar:/Users/timbo/etc= /groovy/groovy-1.8.8/lib/asm-3.2.jar:/Users/timbo/etc/groovy/groovy-1.8.8/l= ib/asm-analysis-3.2.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/asm-common= s-3.2.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/asm-tree-3.2.jar:/Users/= timbo/etc/groovy/groovy-1.8.8/lib/asm-util-3.2.jar:/Users/timbo/etc/groovy/= groovy-1.8.8/lib/bsf-2.4.0.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/com= mons-cli-1.2.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/commons-logging-1= .1.1.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/gpars-1.0-beta-3.jar:/Use= rs/timbo/etc/groovy/groovy-1.8.8/lib/groovy-1.8.8.jar:/Users/timbo/etc/groo= vy/groovy-1.8.8/lib/hamcrest-core-1.1.jar:/Users/timbo/etc/groovy/groovy-1.= 8.8/lib/ivy-2.2.0.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/jansi-1.6.ja= r:/Users/timbo/etc/groovy/groovy-1.8.8/lib/jline-1.0.jar:/Users/timbo/etc/g= roovy/groovy-1.8.8/lib/jsp-api-2.0.jar:/Users/timbo/etc/groovy/groovy-1.8.8= /lib/jsr166y-1.7.0.jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/junit-4.10.= jar:/Users/timbo/etc/groovy/groovy-1.8.8/lib/servlet-api-2.4.jar:/Users/tim= bo/etc/groovy/groovy-1.8.8/lib/xmlpull-1.1.3.1.jar:/Users/timbo/etc/groovy/= groovy-1.8.8/lib/xstream-1.4.1.jar:/Users/timbo/tmp/TestingCamel/lib/camel-= core-2.10.3.jar:/Users/timbo/tmp/TestingCamel/lib/slf4j-api-1.6.6.jar:/User= s/timbo/tmp/TestingCamel/lib/slf4j-simple-1.6.6.jar --encoding=3DUTF-8 /Use= rs/timbo/tmp/TestingCamel/src/Simple.groovy > > 2347 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Cam= el 2.10.3 (CamelContext: camel-1) is starting > > 3832 [main] INFO org.apache.camel.management.ManagementStrategyFactory = - JMX enabled. > > 3996 [main] WARN org.apache.camel.impl.DefaultCamelContext - Lifecycle = strategy org.apache.camel.management.DefaultManagementLifecycleStrategy@410= d3f0d failed starting CamelContext (camel-1) due javax.management.Malformed= ObjectNameException: Could not create ObjectName from: org.apache.camel:con= text=3Dunknown-00:25:4b:c4:94:f4.home/camel-1,type=3Dcontext,name=3D"camel-= 1". Reason: javax.management.MalformedObjectNameException: Invalid characte= r ':' in value part of property > > 4004 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Cam= el 2.10.3 (CamelContext: camel-1) is shutting down > > 4051 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Cam= el 2.10.3 (CamelContext: camel-1) is shutdown in 0.012 seconds. Uptime 1.70= 6 seconds. > > Caught: org.apache.camel.RuntimeCamelException: javax.management.Malfor= medObjectNameException: Could not create ObjectName from: org.apache.camel:= context=3Dunknown-00:25:4b:c4:94:f4.home/camel-1,type=3Dcontext,name=3D"cam= el-1". Reason: javax.management.MalformedObjectNameException: Invalid chara= cter ':' in value part of property > > org.apache.camel.RuntimeCamelException: javax.management.MalformedObjec= tNameException: Could not create ObjectName from: org.apache.camel:context= =3Dunknown-00:25:4b:c4:94:f4.home/camel-1,type=3Dcontext,name=3D"camel-1". = Reason: javax.management.MalformedObjectNameException: Invalid character ':= ' in value part of property > > at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(Obje= ctHelper.java:1271) > > at org.apache.camel.management.DefaultManagementLifecycleStrategy.on= ContextStart(DefaultManagementLifecycleStrategy.java:171) > > at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCam= elContext.java:1512) > > at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelCon= text.java:1444) > > at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java= :60) > > at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelConte= xt.java:1412) > > at org.apache.camel.Service$start.call(Unknown Source) > > at Simple.run(Simple.groovy:12) > > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:1= 20) > > Caused by: javax.management.MalformedObjectNameException: Could not cre= ate ObjectName from: org.apache.camel:context=3Dunknown-00:25:4b:c4:94:f4.h= ome/camel-1,type=3Dcontext,name=3D"camel-1". Reason: javax.management.Malfo= rmedObjectNameException: Invalid character ':' in value part of property > > at org.apache.camel.management.DefaultManagementNamingStrategy.creat= eObjectName(DefaultManagementNamingStrategy.java:317) > > at org.apache.camel.management.DefaultManagementNamingStrategy.getOb= jectNameForCamelContext(DefaultManagementNamingStrategy.java:87) > > at org.apache.camel.management.DefaultManagementLifecycleStrategy.on= ContextStart(DefaultManagementLifecycleStrategy.java:140) > > ... 7 more > > > > Tim > >