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 32F3BD4EB for ; Fri, 5 Oct 2012 17:01:08 +0000 (UTC) Received: (qmail 21118 invoked by uid 500); 5 Oct 2012 17:01:07 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 21001 invoked by uid 500); 5 Oct 2012 17:01:07 -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 Delivered-To: moderator for users@camel.apache.org Received: (qmail 93159 invoked by uid 99); 5 Oct 2012 16:53:39 -0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of markjohndoyle@gmail.com designates 209.85.160.45 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=15XMWT2y4rGHg1smIxc5KdcP9QxsLhYL5dKZR/61L1E=; b=xhtGA/waAc5FucIPb6WKYoLdxPl57SRte1t482QeIjNY8UoZhqry9T5jvbvRnG98rZ 8pBNamApkTBLHU2YSntjYOEt1wMdDBYM1YtiUPiabURivaEdkJ7sESdQWqNEm7ualGfK 0LdpFmLXm6YcT3snkKR1la8ziIezhMVSkYlE0NQjDdUg4NHoMUd316Z1uvZEYKwLuvx2 NxjYvw6Eq8kWDSF45CY3kITIETIrV0iX7X5yOBTILou5g/HN7OPiVGftVZzJA6AtnQqE tM4nN6secTc3AVIf4jwuDp2Xlkafg+jHMPl0v2a0r/GV41Z7Y45GGuAL+pj/HtnkHy7F UahQ== MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 5 Oct 2012 18:53:14 +0200 Message-ID: Subject: Re: Period character issue with camel-mongo. From: Mark Doyle To: users@camel.apache.org Content-Type: multipart/alternative; boundary=f46d042f9492335c6904cb52b5be X-Virus-Checked: Checked by ClamAV on apache.org --f46d042f9492335c6904cb52b5be Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have a little more info. The properties issue is evident on both the command line (mvn install) and running the junit test directly in elipse. I tried the spring 3.1 profile on the command line (mvn clean install -P spring3.1) and got the same problem. What is weird is it suddenly stopped finding the latest camel-test-spring dependency, no version is specified in the POM so unless it's managed in a parent I guess it will go for the latest snapshot. I had to explicitly specify 2.11-SNAPSHOT in the pom to get it to compile again. Having said all that, I still get the Properties issue :) On 4 October 2012 14:20, Raul Kripalani wrote: > Strange, will check this evening and will send you a direct email with my > findings. > Thanks for your collaboration ;) > > Regards, > > *Ra=FAl Kripalani* > Apache Camel Committer > Enterprise Architect, Program Manager, Open Source Integration specialist > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani > http://blog.raulkr.net | twitter: @raulvk > > On Wed, Oct 3, 2012 at 10:23 PM, Mark Doyle > wrote: > > > Hi Raul, > > > > I'm getting the trace below when I try to run the unit tests. Looks lik= e > a > > problem adding the Properties component (using mongdb.test.properties) = to > > the camel spring context. Any ideas? > > > > java.lang.IllegalArgumentException: Cannot add component as its already > > previously added: properties > > at > > > > > org.apache.camel.impl.DefaultCamelContext.addComponent(DefaultCamelContex= t.java:291) > > at > > > > > org.apache.camel.component.mongodb.MongoDbOperationsTest$1.configure(Mong= oDbOperationsTest.java:227) > > at > > > > > org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:= 322) > > at > > > > > org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:2= 76) > > at > > > > > org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilde= r.java:262) > > at > > > > > org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.j= ava:633) > > at > > > > > org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.ja= va:293) > > at > > > > > org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java= :213) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39) > > at > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at > > > > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMeth= od.java:45) > > at > > > > > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallabl= e.java:15) > > at > > > > > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod= .java:42) > > at > > > > > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java= :27) > > at > > > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:3= 0) > > at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47) > > at org.junit.rules.RunRules.evaluate(RunRules.java:18) > > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) > > at > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.= java:68) > > at > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.= java:47) > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) > > at > > > > > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java= :28) > > at > > > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:3= 0) > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300) > > at > > > > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Test= Reference.java:50) > > at > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.jav= a:38) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:467) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:683) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn= er.java:390) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun= ner.java:197) > > > > java.lang.NullPointerException > > at > > > > > org.apache.camel.component.mongodb.AbstractMongoDbTest.cleanup(AbstractMo= ngoDbTest.java:96) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39) > > at > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at > > > > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMeth= od.java:45) > > at > > > > > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallabl= e.java:15) > > at > > > > > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod= .java:42) > > at > > > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:3= 6) > > at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47) > > at org.junit.rules.RunRules.evaluate(RunRules.java:18) > > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) > > at > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.= java:68) > > at > > > > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.= java:47) > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) > > at > > > > > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java= :28) > > at > > > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:3= 0) > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300) > > at > > > > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Test= Reference.java:50) > > at > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.jav= a:38) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:467) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:683) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn= er.java:390) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun= ner.java:197) > > > > > > On 2 October 2012 21:26, Mark Doyle wrote: > > > > > Indeed I would; first job is to figure out how to create a JIRA... > > > > > > as for your question, yes, you assume correctly. It's the following > > simple > > > model object: > > > > > > > > > > > > https://github.com/JohannesKlug/hbird/blob/master/src/core/commons/src/ma= in/java/org/hbird/core/commons/tmtcgroups/HummingbirdParameter.java > > > > > > Which I assume triggers the fromAnyObjectToDBObject method in the > > > MongoDbBasicConverters class? The qualified name field always contain= s > > > periods. > > > > > > > > > On 2 October 2012 20:11, Raul Kripalani wrote: > > > > > >> Hi Mark, > > >> > > >> Correct. Mongo doesn't accept dot characters in field naming because > it > > >> serves as a separator for nested fields, so it's reserved. > > >> > > >> It seems like a great idea. Please feel free to create a JIRA. Would > you > > >> be > > >> happy to work on a patch? If you want I can provide you with some > > guidance > > >> since I know this component inside out because I created it ;) > > >> > > >> There are a number of type converters that MongoDB provides... What'= s > > the > > >> original payload type before it hits the MongoDB endpoint? (Object, > > >> HashMap, etc.). I assume it's an Object but please confirm. > > >> > > >> Thanks, > > >> > > >> -- > > >> *Ra=FAl Kripalani* > > >> Apache Camel Committer > > >> Enterprise Architect, Program Manager, Open Source Integration > > specialist > > >> http://about.me/raulkripalani | > > http://www.linkedin.com/in/raulkripalani > > >> http://blog.raulkr.net | twitter: @raulvk > > >> > > >> > > >> On Tue, Oct 2, 2012 at 4:22 PM, Mark Doyle > > >> wrote: > > >> > > >> > I have a problem where a String field contains a period. This caus= es > > the > > >> > following exception: > > >> > > > >> > Caused by: java.lang.IllegalArgumentException: fields stored in th= e > db > > >> > can't have . in them. (Bad Key: 'Stock6.tm.Azimuth') > > >> > > > >> > which I believe stems from restrictions in the depths of the mongo= ! > > >> > > > >> > The solution seems to be to convert the character to something els= e > > >> (e.g. a > > >> > comma) before inserting and back again after finding. Does this se= em > > >> like > > >> > something the camel-mongo component should offer as an option, or > even > > >> > silently deal with by default? Could it be a change in the type > > >> converters? > > >> > I think that uses Jackson to build the DB object and therefore cou= ld > > >> filter > > >> > out and replace periods. I suppose a user could run into problems = if > > >> they > > >> > overrode the converters with their own. > > >> > > > >> > I don't know how camel works under the covers so this might not > work, > > >> > especially if the converters aren't used to create a real object > from > > >> > the DBObject returned by Mongo. > > >> > > > >> > > > > > > > > > --f46d042f9492335c6904cb52b5be--