Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27656 > unrolled thread

error in getting bean in springconfig .xml

Started byNavneet Mathpal <navneetmathpal93@gmail.com>
First post2014-03-03 01:13 -0800
Last post2014-03-03 03:55 -0600
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  error in getting bean in springconfig .xml Navneet Mathpal <navneetmathpal93@gmail.com> - 2014-03-03 01:13 -0800
    Re: error in getting bean in springconfig .xml leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-03 03:55 -0600

#27656 — error in getting bean in springconfig .xml

FromNavneet Mathpal <navneetmathpal93@gmail.com>
Date2014-03-03 01:13 -0800
Subjecterror in getting bean in springconfig .xml
Message-ID<6cb3737b-5e4d-445b-8494-f537bb72b66c@googlegroups.com>
Hi

i am using a springconfig for get the bean for mongodb but it is showing error why
here is springconfig

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mongo="http://www.springframework.org/schema/data/mongo"
	xsi:schemaLocation="http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.springframework.org/schema/data/mongo
          http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
     
	     <mongo:mongo host="u-678044427" port="27017" />
	<mongo:db-factory dbname="yourdb" />
 
	<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
		<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
	</bean>
 
</beans>



and for getting this 

 DB s =mongoTemplate.getDb();
		System.out.println(s);
		DBCollection con=s.getCollection("test");

and then con.insert 

 

[toc] | [next] | [standalone]


#27658

Fromleif.roar@invalid.com (Leif Roar Moldskred)
Date2014-03-03 03:55 -0600
Message-ID<f5Wdnf4nz4oczInOnZ2dnUVZ8sqdnZ2d@giganews.com>
In reply to#27656
Navneet Mathpal <navneetmathpal93@gmail.com> wrote:
> Hi
> 
> i am using a springconfig for get the bean for mongodb but it is showing error why
> here is springconfig

You would probably be better served by asking for help in a forum
specifically targetted at MongoDB. It's not certain anyone here knows
enough about Mongo to be able to help you.

Regardless, when you do ask for help, you will at the very least have to include
the exact error-message and any stack trace. It's not very easy to help you
with an error if you don't tell people what the error _is_.

-- 
Leif Roar Moldskred

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web