Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.39 KB | None | 0 0
  1. Failed to authenticate to database [dbname], username = [admin], password = [password]
  2.  
  3. Refreshing Root WebApplicationContext: startup date [Sun Oct 30 00:55:43 PKT
  4.  
  5. 2016]; root of context hierarchy
  6. INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
  7. INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [mongo-config.xml]
  8. ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
  9. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:mongo-config.xml]
  10. Offending resource: ServletContext resource [/WEB-INF/spring/root-context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [mongo-config.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment;
  11. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
  12.  
  13. <?xml version="1.0" encoding="UTF-8"?>
  14. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  15. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  16. <modelVersion>4.0.0</modelVersion>
  17. <groupId>com.support</groupId>
  18. <artifactId>child</artifactId>
  19. <name>support</name>
  20. <packaging>war</packaging>
  21. <version>1.0.0-BUILD-SNAPSHOT</version>
  22. <properties>
  23. <java-version>1.6</java-version>
  24. <org.springframework-version>3.1.1.RELEASE</org.springframework-version>
  25. <org.aspectj-version>1.6.10</org.aspectj-version>
  26. <org.slf4j-version>1.6.6</org.slf4j-version>
  27. <java-mail.version>1.4.7</java-mail.version>
  28. </properties>
  29. <dependencies>
  30. <!-- Spring -->
  31. <dependency>
  32. <groupId>org.springframework</groupId>
  33. <artifactId>spring-context</artifactId>
  34. <version>${org.springframework-version}</version>
  35. <exclusions>
  36. <!-- Exclude Commons Logging in favor of SLF4j -->
  37. <exclusion>
  38. <groupId>commons-logging</groupId>
  39. <artifactId>commons-logging</artifactId>
  40. </exclusion>
  41. </exclusions>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.springframework</groupId>
  45. <artifactId>spring-webmvc</artifactId>
  46. <version>${org.springframework-version}</version>
  47. </dependency>
  48.  
  49. <dependency>
  50. <groupId>org.springframework</groupId>
  51. <artifactId>spring-web</artifactId>
  52. <version>${org.springframework-version}</version>
  53. </dependency>
  54.  
  55. <dependency>
  56. <groupId>com.fasterxml.jackson.core</groupId>
  57. <artifactId>jackson-core</artifactId>
  58. <version>2.0.2</version>
  59. </dependency>
  60.  
  61.  
  62. <dependency>
  63. <groupId>org.springframework</groupId>
  64. <artifactId>spring-core</artifactId>
  65. <version>${org.springframework-version}</version>
  66. </dependency>
  67.  
  68. <!-- AspectJ -->
  69. <dependency>
  70. <groupId>org.aspectj</groupId>
  71. <artifactId>aspectjrt</artifactId>
  72. <version>${org.aspectj-version}</version>
  73. </dependency>
  74.  
  75. <!-- Logging -->
  76. <dependency>
  77. <groupId>org.slf4j</groupId>
  78. <artifactId>slf4j-api</artifactId>
  79. <version>${org.slf4j-version}</version>
  80. </dependency>
  81. <dependency>
  82. <groupId>org.slf4j</groupId>
  83. <artifactId>jcl-over-slf4j</artifactId>
  84. <version>${org.slf4j-version}</version>
  85. <scope>runtime</scope>
  86. </dependency>
  87. <dependency>
  88. <groupId>org.slf4j</groupId>
  89. <artifactId>slf4j-log4j12</artifactId>
  90. <version>${org.slf4j-version}</version>
  91. <scope>runtime</scope>
  92. </dependency>
  93. <dependency>
  94. <groupId>javax.mail</groupId>
  95. <artifactId>mail</artifactId>
  96. <version>${java-mail.version}</version>
  97. </dependency>
  98. <dependency>
  99. <groupId>log4j</groupId>
  100. <artifactId>log4j</artifactId>
  101. <version>1.2.15</version>
  102. <exclusions>
  103. <exclusion>
  104. <groupId>javax.mail</groupId>
  105. <artifactId>mail</artifactId>
  106. </exclusion>
  107. <exclusion>
  108. <groupId>javax.jms</groupId>
  109. <artifactId>jms</artifactId>
  110. </exclusion>
  111. <exclusion>
  112. <groupId>com.sun.jdmk</groupId>
  113. <artifactId>jmxtools</artifactId>
  114. </exclusion>
  115. <exclusion>
  116. <groupId>com.sun.jmx</groupId>
  117. <artifactId>jmxri</artifactId>
  118. </exclusion>
  119. </exclusions>
  120. <scope>runtime</scope>
  121. </dependency>
  122.  
  123. <!-- @Inject -->
  124. <dependency>
  125. <groupId>javax.inject</groupId>
  126. <artifactId>javax.inject</artifactId>
  127. <version>1</version>
  128. </dependency>
  129.  
  130. <!-- Servlet -->
  131. <dependency>
  132. <groupId>javax.servlet</groupId>
  133. <artifactId>servlet-api</artifactId>
  134. <version>2.5</version>
  135. <scope>provided</scope>
  136. </dependency>
  137. <dependency>
  138. <groupId>javax.servlet.jsp</groupId>
  139. <artifactId>jsp-api</artifactId>
  140. <version>2.1</version>
  141. <scope>provided</scope>
  142. </dependency>
  143. <dependency>
  144. <groupId>javax.servlet</groupId>
  145. <artifactId>jstl</artifactId>
  146. <version>1.2</version>
  147. </dependency>
  148.  
  149. <!-- Test -->
  150. <dependency>
  151. <groupId>junit</groupId>
  152. <artifactId>junit</artifactId>
  153. <version>4.7</version>
  154. <scope>test</scope>
  155. </dependency>
  156.  
  157. <!-- MongoDB -->
  158. <dependency>
  159. <groupId>org.apache.velocity</groupId>
  160. <artifactId>velocity</artifactId>
  161. <version>1.7</version>
  162. </dependency>
  163.  
  164. <dependency>
  165. <groupId>org.apache.velocity</groupId>
  166. <artifactId>velocity-tools</artifactId>
  167. <version>2.0</version>
  168. </dependency>
  169.  
  170. <dependency>
  171. <groupId>org.springframework.data</groupId>
  172. <artifactId>spring-data-mongodb</artifactId>
  173. <version>1.8.1.RELEASE</version>
  174. </dependency>
  175. <dependency>
  176. <groupId>org.mongodb</groupId>
  177. <artifactId>mongo-java-driver</artifactId>
  178. <version>2.9.3</version>
  179. </dependency>
  180.  
  181. <!-- spring security -->
  182. <dependency>
  183. <groupId>org.springframework.security</groupId>
  184. <artifactId>spring-security-core</artifactId>
  185. <version>${org.springframework-version}</version>
  186. </dependency>
  187.  
  188. <dependency>
  189. <groupId>org.springframework.security</groupId>
  190. <artifactId>spring-security-web</artifactId>
  191. <version>${org.springframework-version}</version>
  192. </dependency>
  193.  
  194. <dependency>
  195. <groupId>org.springframework.security</groupId>
  196. <artifactId>spring-security-config</artifactId>
  197. <version>${org.springframework-version}</version>
  198. </dependency>
  199.  
  200.  
  201. <!-- Validation -->
  202.  
  203. <dependency>
  204. <groupId>javax.validation</groupId>
  205. <artifactId>validation-api</artifactId>
  206. <version>1.0.0.GA</version>
  207. </dependency>
  208. <dependency>
  209. <groupId>org.hibernate</groupId>
  210. <artifactId>hibernate-validator-annotation-processor</artifactId>
  211. <version>4.2.0.Final</version>
  212. </dependency>
  213.  
  214.  
  215. </dependencies>
  216. <build>
  217. <plugins>
  218. <plugin>
  219. <artifactId>maven-eclipse-plugin</artifactId>
  220. <version>2.9</version>
  221. <configuration>
  222. <additionalProjectnatures>
  223. <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
  224. </additionalProjectnatures>
  225. <additionalBuildcommands>
  226. <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
  227. </additionalBuildcommands>
  228. <downloadSources>true</downloadSources>
  229. <downloadJavadocs>true</downloadJavadocs>
  230. </configuration>
  231. </plugin>
  232. <plugin>
  233. <groupId>org.apache.maven.plugins</groupId>
  234. <artifactId>maven-dependency-plugin</artifactId>
  235. <version>2.3</version>
  236. <executions>
  237. <execution>
  238. <phase>package</phase>
  239. <goals>
  240. <goal>copy</goal>
  241. </goals>
  242. <configuration>
  243. <artifactItems>
  244. <artifactItem>
  245. <groupId>org.mortbay.jetty</groupId>
  246. <artifactId>jetty-runner</artifactId>
  247. <version>7.4.5.v20110725</version>
  248. <destFileName>jetty-runner.jar</destFileName>
  249. </artifactItem>
  250. </artifactItems>
  251. </configuration>
  252. </execution>
  253. </executions>
  254. </plugin>
  255.  
  256. <plugin>
  257. <groupId>org.apache.maven.plugins</groupId>
  258. <artifactId>maven-compiler-plugin</artifactId>
  259. <version>2.5.1</version>
  260. <configuration>
  261. <source>1.6</source>
  262. <target>1.6</target>
  263. <compilerArgument>-Xlint:all</compilerArgument>
  264. <showWarnings>true</showWarnings>
  265. <showDeprecation>true</showDeprecation>
  266. </configuration>
  267. </plugin>
  268. <plugin>
  269. <groupId>org.codehaus.mojo</groupId>
  270. <artifactId>exec-maven-plugin</artifactId>
  271. <version>1.2.1</version>
  272. <configuration>
  273. <mainClass>org.test.int1.Main</mainClass>
  274. </configuration>
  275. </plugin>
  276. </plugins>
  277. </build>
  278. <profiles>
  279. <profile>
  280. <!-- When built in OpenShift the 'openshift' profile will be used when
  281. invoking mvn. -->
  282. <!-- Use this profile for any OpenShift specific customization your app
  283. will need. -->
  284. <!-- By default that is to put the resulting archive into the 'webapps'
  285. folder. -->
  286. <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
  287. <id>openshift</id>
  288. <build>
  289. <finalName>sharebooks</finalName>
  290. <plugins>
  291. <plugin>
  292. <artifactId>maven-war-plugin</artifactId>
  293. <version>2.1.1</version>
  294. <configuration>
  295. <outputDirectory>webapps</outputDirectory>
  296. <warName>ROOT</warName>
  297. </configuration>
  298. </plugin>
  299. </plugins>
  300. </build>
  301. </profile>
  302. </profiles>
  303. </project>
  304.  
  305. <?xml version="1.0" encoding="UTF-8"?>
  306. <beans xmlns="http://www.springframework.org/schema/beans"
  307. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  308. xmlns:c="http://www.springframework.org/schema/c" xmlns:tx="http://www.springframework.org/schema/tx"
  309. xmlns:context="http://www.springframework.org/schema/context"
  310. xmlns:mongo="http://www.springframework.org/schema/data/mongo"
  311. xmlns:util="http://www.springframework.org/schema/util"
  312. xsi:schemaLocation="
  313. http://www.springframework.org/schema/beans
  314. http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  315. http://www.springframework.org/schema/tx
  316. http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
  317. http://www.springframework.org/schema/context
  318. http://www.springframework.org/schema/context/spring-context-3.1.xsd
  319. http://www.springframework.org/schema/data/mongo
  320. http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
  321. http://www.springframework.org/schema/util
  322. http://www.springframework.org/schema/util/spring-util-3.1.xsd">
  323.  
  324. <!-- uncomment before deployment -->
  325.  
  326. <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
  327. <constructor-arg name="mongo" ref="mongo" />
  328. <constructor-arg name="databaseName" value="#{mongoUri.database}" />
  329. <constructor-arg name="userCredentials" ref="mongoCredentials" />
  330.  
  331. <property name="writeResultChecking">
  332. <util:constant static-field="org.springframework.data.mongodb.core.WriteResultChecking.EXCEPTION" ></util:constant>
  333. </property>
  334. </bean>
  335.  
  336. <bean id="mongoCredentials" class="org.springframework.data.authentication.UserCredentials">
  337. <constructor-arg name="username" value="#{mongoUri.username}" />
  338. <constructor-arg name="password"
  339. value="#{new java.lang.String(mongoUri.password)}" />
  340. </bean>
  341.  
  342. <bean id="mongoUri" class="com.mongodb.MongoURI">
  343.  
  344. <constructor-arg
  345. value="mongodb://admin:password@localhost:27017/dbname"/>
  346. </bean>
  347.  
  348. <bean class="com.mongodb.Mongo" id="mongo">
  349. <constructor-arg ref="mongoUri" />
  350. </bean>
  351.  
  352. <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials">
  353. <constructor-arg name="username" value="#{mongoUri.username}" />
  354. <constructor-arg name="password"
  355. value="#{new java.lang.String(mongoUri.password)}" />
  356. </bean>
  357.  
  358. <mongo:repositories base-package="com.support.child.repositories" />
  359.  
  360.  
  361. </beans>
  362.  
  363. The errors below were detected when validating the file "spring-beans-3.1.xsd" via the file "mongo-config.xml". In most cases these errors can be detected by validating "spring-beans-3.1.xsd" directly. However it is possible that errors will only occur when spring-beans-3.1.xsd is validated in the context of mongo-config.xml.
  364.  
  365. The errors below were detected when validating the file "spring-context-3.1.xsd" via the file "mongo-config.xml". In most cases these errors can be detected by validating "spring-context-3.1.xsd" directly. However it is possible that errors will only occur when spring-context-3.1.xsd is validated in the context of mongo-config.xml.
  366.  
  367. The errors below were detected when validating the file "spring-tool-3.1.xsd" via the file "mongo-config.xml". In most cases these errors can be detected by validating "spring-tool-3.1.xsd" directly. However it is possible that errors will only occur when spring-tool-3.1.xsd is validated in the context of mongo-config.xml.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement