Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Java [игнор отключен] [закрыт для гостей] / AppFuse change database profile / 4 сообщений из 4, страница 1 из 1
17.08.2013, 13:35:11
    #38369702
Dzib
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AppFuse change database profile
Привет всем. Не пойму не как сменить database profile в AppFuse.
Есть такая помка
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>some</groupId>
	<artifactId>my</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>AppFuse JSF Application</name>
	<url>http://www.mycompany.com</url>

	<prerequisites>
		<maven>2.2.1</maven>
	</prerequisites>

	<!--<licenses> <license> <name></name> <url></url> </license> </licenses> 
		<scm> <connection></connection> <developerConnection></developerConnection> 
		<url></url> </scm> <issueManagement> <system></system> <url></url> </issueManagement> 
		<developers> <developer> <id></id> <name></name> <email></email> <timezone></timezone> 
		</developer> </developers> -->

	<build>
		<defaultGoal>install</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.appfuse.plugins</groupId>
				<artifactId>appfuse-maven-plugin</artifactId>
				<version>${appfuse.version}</version>
				<configuration>
					<!-- Fix annotation detection issue for Java 7. Thanks Shred! -->
					<!-- http://www.shredzone.de/cilla/page/352/hibernate3-maven-plugin-fails-with-java-17.html -->
					<componentProperties>
						<implementation>annotationconfiguration</implementation>
					</componentProperties>
					<genericCore>${amp.genericCore}</genericCore>
					<fullSource>${amp.fullSource}</fullSource>
				</configuration>
				<!-- Dependency needed by appfuse:gen-model to connect to database. -->
				<!-- See http://issues.appfuse.org/browse/APF-868 to learn more. -->
				<dependencies>
					<dependency>
						<groupId>${jdbc.groupId}</groupId>
						<artifactId>${jdbc.artifactId}</artifactId>
						<version>${jdbc.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>hibernate3-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<components>
						<component>
							<name>hbm2ddl</name>
							<implementation>annotationconfiguration</implementation>
							<!-- Use 'jpaconfiguration' if you're using JPA. -->
							<!--<implementation>jpaconfiguration</implementation> -->
						</component>
					</components>
					<componentProperties>
						<drop>true</drop>
						<jdk5>true</jdk5>
						<propertyfile>${project.build.outputDirectory}/jdbc.properties</propertyfile>
						<skip>${skipTests}</skip>
					</componentProperties>
				</configuration>
				<executions>
					<execution>
						<phase>process-test-resources</phase>
						<goals>
							<goal>hbm2ddl</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>${jdbc.groupId}</groupId>
						<artifactId>${jdbc.artifactId}</artifactId>
						<version>${jdbc.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>dbunit-maven-plugin</artifactId>
				<version>1.0-beta-3</version>
				<configuration>
					<dataTypeFactoryName>${dbunit.dataTypeFactoryName}</dataTypeFactoryName>
					<driver>${jdbc.driverClassName}</driver>
					<username>${jdbc.username}</username>
					<password>${jdbc.password}</password>
					<url>${jdbc.url}</url>
					<src>src/test/resources/sample-data.xml</src>
					<type>${dbunit.operation.type}</type>
					<schema>${dbunit.schema}</schema>
					<skip>${skipTests}</skip>
					<transaction>true</transaction>
				</configuration>
				<executions>
					<execution>
						<id>test-compile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>operation</goal>
						</goals>
					</execution>
					<execution>
						<!-- Runs before integration tests and jetty:run-war -->
						<id>test</id>
						<phase>test</phase>
						<goals>
							<goal>operation</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>${jdbc.groupId}</groupId>
						<artifactId>${jdbc.artifactId}</artifactId>
						<version>${jdbc.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>8.1.3.v20120416</version>
				<configuration>
					<webApp>
						<contextPath>/</contextPath>
					</webApp>
				</configuration>
			</plugin>
			<!-- clean-up previous hibernate-search indexed from integration tests, 
				as there could be a lock -->
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>${user.home}/${project.build.finalName}/index</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<!-- will package a ready-to-run app regarding hibernate-search index 
				location -->
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.3</version>
				<configuration>
					<escapeString>\</escapeString>
					<webResources>
						<resource>
							<directory>src/main/resources/packaged</directory>
							<targetPath>WEB-INF/classes</targetPath>
							<filtering>true</filtering>
							<includes>
								<include>hibernate.properties</include>
							</includes>
						</resource>
					</webResources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>native2ascii-maven-plugin</artifactId>
				<version>1.0-beta-1</version>
				<executions>
					<execution>
						<id>native2ascii-utf8</id>
						<goals>
							<goal>native2ascii</goal>
						</goals>
						<configuration>
							<encoding>UTF8</encoding>
							<includes>
								<include>ApplicationResources_zh*.properties</include>
								<include>ApplicationResources_ko*.properties</include>
							</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>true</filtering>
			</testResource>
			<testResource>
				<directory>src/main/webapp</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/*.xml</include>
				</includes>
			</testResource>
		</testResources>
	</build>

	<repositories>
		<repository>
			<id>appfuse-snapshots</id>
			<url>http://oss.sonatype.org/content/repositories/appfuse-snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>appfuse-snapshots</id>
			<url>http://oss.sonatype.org/content/repositories/appfuse-snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

	<dependencies>
		<dependency>
			<groupId>org.appfuse</groupId>
			<artifactId>appfuse-web</artifactId>
			<version>${appfuse.version}</version>
			<type>pom</type>
			<!-- This exclusion and the dependency following this one allow DAO framework 
				switching. -->
			<!-- You only need these if you want to use JPA or iBATIS. See APF-565 
				for more information. -->
			<!-- It does no harm to leave it in for Hibernate, but it's not needed. -->
			<exclusions>
				<exclusion>
					<groupId>org.appfuse</groupId>
					<artifactId>appfuse-hibernate</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.appfuse</groupId>
			<artifactId>appfuse-${dao.framework}</artifactId>
			<version>${appfuse.version}</version>
		</dependency>
		<dependency>
			<groupId>${jdbc.groupId}</groupId>
			<artifactId>${jdbc.artifactId}</artifactId>
			<version>${jdbc.version}</version>
		</dependency>
		<dependency>
			<groupId>net.java.dev.ajax4jsf</groupId>
			<artifactId>ajax4jsf</artifactId>
			<version>${ajax4jsf.version}</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.jsf-comp</groupId>
			<artifactId>acegi-jsf</artifactId>
			<version>${acegijsf.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.acegisecurity</groupId>
					<artifactId>acegi-security</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.sun.facelets</groupId>
			<artifactId>jsf-facelets</artifactId>
			<version>${facelets.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shale</groupId>
			<artifactId>shale-validator</artifactId>
			<version>${shale.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-api</artifactId>
			<version>${myfaces.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-impl</artifactId>
			<version>${myfaces.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.tomahawk</groupId>
			<artifactId>tomahawk20</artifactId>
			<version>${myfaces.tomahawk.version}</version>
		</dependency>
		<dependency>
			<groupId>com.ocpsoft</groupId>
			<artifactId>prettyfaces-jsf2</artifactId>
			<version>3.3.3</version>
		</dependency>
		<!-- Upgrade version of commons-io used by Tomahawk -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons.io.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>${jsp.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>${servlet.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.jmock</groupId>
			<artifactId>jmock</artifactId>
			<version>${jmock.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jmock</groupId>
			<artifactId>jmock-junit4</artifactId>
			<version>${jmock.version}</version>
			<scope>test</scope>
		</dependency>
		<!-- Upgrade junit-dep used by jmock -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit-dep</artifactId>
			<version>4.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.shale</groupId>
			<artifactId>shale-test</artifactId>
			<version>${shale.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.subethamail</groupId>
			<artifactId>subethasmtp-wiser</artifactId>
			<version>${wiser.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>el-api</artifactId>
			<version>1.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<reporting>
		<plugins>
			<plugin>
				<artifactId>maven-changes-plugin</artifactId>
				<version>2.8</version>
			</plugin>
			<plugin>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<consoleOutput>true</consoleOutput>
					<configLocation>https://raw.github.com/appfuse/appfuse/master/www/checkstyle.xml</configLocation>
					<failsOnError>false</failsOnError>
					<maxAllowedViolations>3</maxAllowedViolations>
				</configuration>
				<version>2.9.1</version>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<configuration>
					<instrumentation>
						<excludes>
							<exclude>**/model/*.class</exclude>
						</excludes>
					</instrumentation>
				</configuration>
				<version>2.5.2</version>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9</version>
			</plugin>
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
				<version>2.3</version>
			</plugin>
			<plugin>
				<artifactId>maven-pmd-plugin</artifactId>
				<configuration>
					<linkXRef>true</linkXRef>
					<targetJdk>1.6</targetJdk>
				</configuration>
				<version>2.7.1</version>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>2.12.4</version>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>webtest-maven-plugin</artifactId>
				<version>1.0.0</version>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>integration-test</id>
			<activation>
				<property>
					<name>!skipTests</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.cargo</groupId>
						<artifactId>cargo-maven2-plugin</artifactId>
						<version>${cargo.version}</version>
						<configuration>
							<wait>${cargo.wait}</wait>
							<container>
								<containerId>${cargo.container}</containerId>
								<home>${cargo.container.home}</home>
								<zipUrlInstaller>
									<url>${cargo.container.url}</url>
									<extractDir>${installDir}</extractDir>
								</zipUrlInstaller>
							</container>
							<configuration>
								<home>${project.build.directory}/${cargo.container}/container</home>
								<properties>
									<cargo.hostname>${cargo.host}</cargo.hostname>
									<cargo.servlet.port>${cargo.port}</cargo.servlet.port>
									<!-- To prevent conflicts with already running instances -->
									<cargo.tomcat.ajp.port>8123</cargo.tomcat.ajp.port>
								</properties>
							</configuration>
						</configuration>
						<executions>
							<execution>
								<id>start-container</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>start</goal>
								</goals>
							</execution>
							<execution>
								<id>stop-container</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>stop</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>webtest-maven-plugin</artifactId>
						<version>1.0.0</version>
						<executions>
							<execution>
								<id>webtest-test</id>
								<phase>integration-test</phase>
								<goals>
									<goal>test</goal>
								</goals>
							</execution>
							<execution>
								<id>webtest-verify</id>
								<phase>verify</phase>
								<goals>
									<goal>verify-result</goal>
								</goals>
							</execution>
							<execution>
								<id>webtest-report-html</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<host>${cargo.host}</host>
							<port>${cargo.port}</port>
							<sourcedirectory>src/test/resources</sourcedirectory>
							<sourcefile>web-tests.xml</sourcefile>
							<target>${webtest.target}</target>
							<basepath>${project.build.finalName}</basepath>
							<resultpath>target/webtest/webtest-results</resultpath>
							<haltonfailure>false</haltonfailure>
							<haltonerror>false</haltonerror>
							<loglevel>fatal</loglevel>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- ================= Production Settings Profile ================= -->
		<!-- Use "-P prod" when you want to use the settings in this profile -->
		<!-- =============================================================== -->
		<profile>
			<id>prod</id>
			<build>
				<plugins>
					<!-- Override location of data file for DbUnit to load (doesn't have 
						negative keys) -->
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>dbunit-maven-plugin</artifactId>
						<configuration>
							<src>src/main/resources/default-data.xml</src>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- ================= Database Profiles ================= -->
		<profile>
			<id>derby</id>
			<properties>
				<hibernate.dialect>org.hibernate.dialect.DerbyDialect</hibernate.dialect>
				<jdbc.groupId>org.apache.derby</jdbc.groupId>
				<jdbc.artifactId>derbyclient</jdbc.artifactId>
				<jdbc.version>10.2.2.0</jdbc.version>
				<jdbc.driverClassName>org.apache.derby.jdbc.ClientDriver</jdbc.driverClassName>
				<jdbc.url>jdbc:derby://localhost/${db.name};create=true</jdbc.url>
				<jdbc.username>any</jdbc.username>
				<jdbc.password>value</jdbc.password>
			</properties>
		</profile>
		<profile>
			<id>h2</id>
			<properties>
				<dbunit.dataTypeFactoryName>org.dbunit.ext.h2.H2DataTypeFactory</dbunit.dataTypeFactoryName>
				<hibernate.dialect>org.hibernate.dialect.H2Dialect</hibernate.dialect>
				<jdbc.groupId>com.h2database</jdbc.groupId>
				<jdbc.artifactId>h2</jdbc.artifactId>
				<jdbc.version>1.3.170</jdbc.version>
				<jdbc.driverClassName>org.h2.Driver</jdbc.driverClassName>
				<jdbc.url>jdbc:h2:/tmp/${db.name};MVCC=TRUE</jdbc.url>
				<jdbc.username>sa</jdbc.username>
			</properties>
		</profile>
		<profile>
			<id>hsqldb</id>
			<properties>
				<dbunit.dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</dbunit.dataTypeFactoryName>
				<hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
				<jdbc.groupId>org.hsqldb</jdbc.groupId>
				<jdbc.artifactId>hsqldb</jdbc.artifactId>
				<jdbc.version>2.2.9</jdbc.version>
				<jdbc.driverClassName>org.hsqldb.jdbcDriver</jdbc.driverClassName>
				<jdbc.url>jdbc:hsqldb:/tmp/${db.name};shutdown=true</jdbc.url>
				<jdbc.username>sa</jdbc.username>
			</properties>
		</profile>
		<profile>
			<id>oracle</id>
			<properties>
				<dbunit.dataTypeFactoryName>org.dbunit.ext.oracle.OracleDataTypeFactory</dbunit.dataTypeFactoryName>
				<dbunit.schema>SYSTEM</dbunit.schema> <!-- Make sure to capitalize the schema name -->
				<hibernate.dialect>org.hibernate.dialect.Oracle9Dialect</hibernate.dialect>
				<jdbc.groupId>com.oracle</jdbc.groupId>
				<jdbc.artifactId>ojdbc14</jdbc.artifactId>
				<jdbc.version>10.2.0.2.0</jdbc.version>
				<jdbc.driverClassName>oracle.jdbc.OracleDriver</jdbc.driverClassName>
				<jdbc.url>jdbc:oracle:thin:@localhost:1521:XE</jdbc.url>
				<jdbc.username>system</jdbc.username>
				<jdbc.password>system</jdbc.password>
			</properties>
		</profile>
		<profile>
			<id>postgresql</id>
			<properties>
				<hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</hibernate.dialect>
				<jdbc.groupId>postgresql</jdbc.groupId>
				<jdbc.artifactId>postgresql</jdbc.artifactId>
				<jdbc.version>8.1-407.jdbc3</jdbc.version>
				<jdbc.driverClassName>org.postgresql.Driver</jdbc.driverClassName>
				<jdbc.url>jdbc:postgresql://localhost/${db.name}</jdbc.url>
				<jdbc.username>postgres</jdbc.username>
				<jdbc.password>postgres</jdbc.password>
			</properties>
		</profile>
		<profile>			
			<!-- You need to enable TCP/IP Connections for SQL Server 2005 after installing. -->
			<!-- http://www.mattwoodward.com/blog/index.cfm?commentID=211 -->
			<id>sqlserver</id>
			<properties>
				<dbunit.dataTypeFactoryName>org.dbunit.ext.mssql.MsSqlDataTypeFactory</dbunit.dataTypeFactoryName>
				<dbunit.operation.type>MSSQL_CLEAN_INSERT</dbunit.operation.type>
				<hibernate.dialect>org.hibernate.dialect.SQLServerDialect</hibernate.dialect>
				<jdbc.groupId>net.sourceforge.jtds</jdbc.groupId>
				<jdbc.artifactId>jtds</jdbc.artifactId>
				<jdbc.version>1.2</jdbc.version>
				<jdbc.driverClassName>net.sourceforge.jtds.jdbc.Driver</jdbc.driverClassName>
				<jdbc.url>jdbc:jtds:sqlserver://localhost:3683/${db.name}</jdbc.url>
				<jdbc.username>sa</jdbc.username>
				<jdbc.password>appfuse</jdbc.password>
			</properties>
		</profile>

		<!-- ================= Container Profiles ================= -->
		<profile>
			<id>jboss</id>
			<!-- Add el-api dependency since JBoss 4.0.5 uses Tomcat 5.5.x and JBoss 
				4.2.0 doesn't work with Cargo -->
			<dependencies>
				<dependency>
					<groupId>javax.el</groupId>
					<artifactId>el-api</artifactId>
					<version>${el.version}</version>
				</dependency>
			</dependencies>
			<properties>
				<cargo.container>jboss4x</cargo.container>
				<cargo.container.home>${env.JBOSS_HOME}</cargo.container.home>
				<cargo.container.url>http://easynews.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.5.GA.zip</cargo.container.url>
			</properties>
		</profile>
	</profiles>

	<properties>
		<!-- Application settings -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<copyright.year>2012</copyright.year>
		<dao.framework>hibernate</dao.framework>
		<web.framework>jsf</web.framework>
		<amp.genericCore>true</amp.genericCore>
		<amp.fullSource>false</amp.fullSource>
		<db.name>my</db.name>

		<!-- Framework dependency versions -->
		<acegijsf.version>1.1.3</acegijsf.version>
		<ajax4jsf.version>1.0.6</ajax4jsf.version>
		<appfuse.version>2.2.1</appfuse.version>
		<commons.io.version>2.0.1</commons.io.version>
		<el.version>1.2</el.version>
		<facelets.version>1.1.14</facelets.version>
		<myfaces.version>2.1.9</myfaces.version>
		<myfaces.tomahawk.version>1.1.14</myfaces.tomahawk.version>
		<spring.version>3.1.3.RELEASE</spring.version>

		<!-- Testing dependency versions -->
		<cargo.version>1.2.4</cargo.version>
		<jmock.version>2.5.1</jmock.version>
		<jsp.version>2.1</jsp.version>
		<junit.version>4.10</junit.version>
		<servlet.version>2.5</servlet.version>
		<shale.version>1.0.5</shale.version>
		<wiser.version>1.2</wiser.version>

		<!-- WebTest default target -->
		<webtest.target>run-all-tests</webtest.target>

		<cargo.container>tomcat7x</cargo.container>
		<cargo.container.home>${env.CATALINA_HOME}</cargo.container.home>
		<cargo.container.url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.33/bin/apache-tomcat-7.0.33.zip</cargo.container.url>
		<cargo.host>localhost</cargo.host>
		<cargo.port>8081</cargo.port>
		<cargo.wait>false</cargo.wait>

		<!-- Jetty Cargo settings: <cargo.container>jetty6x</cargo.container> <cargo.container.url>http://dist.codehaus.org/jetty/jetty-6.1.21/jetty-6.1.21.zip</cargo.container.url> -->

		<!-- Database settings -->
		<dbunit.dataTypeFactoryName>org.dbunit.ext.mysql.MySqlDataTypeFactory</dbunit.dataTypeFactoryName>
		<dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
		<hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</hibernate.dialect>
		<jdbc.groupId>mysql</jdbc.groupId>
		<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
		<jdbc.version>5.1.22</jdbc.version>
		<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
		<jdbc.url>jdbc:mysql://localhost/${db.name}?createDatabaseIfNotExist=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=utf-8&amp;amp;autoReconnect=true</jdbc.url>
		<jdbc.username>root</jdbc.username>
		<jdbc.password></jdbc.password>
	</properties>
</project>


hibernate.cfg.xml
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
<!-- NOTE: If you're working offline, you might have to change the DOCTYPE to the following:
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">-->
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <mapping class="org.appfuse.model.User"/>
        <mapping class="org.appfuse.model.Role"/>
    </session-factory>
</hibernate-configuration>



jdbc.properties

Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
jdbc.driverClassName=${jdbc.driverClassName}
jdbc.url=${jdbc.url}
jdbc.username=${jdbc.username}
jdbc.password=${jdbc.password}

hibernate.dialect=${hibernate.dialect}

# Needed by Hibernate3 Maven Plugin defined in pom.xml
hibernate.connection.username=${jdbc.username}
hibernate.connection.password=${jdbc.password}
hibernate.connection.url=${jdbc.url}
hibernate.connection.driver_class=${jdbc.driverClassName}



По умолчанию используется mysql, я хочу mssql. Погуглил предлагают поставить в помке в профиле
Код: xml
1.
2.
3.
<activation>
    <activeByDefault>true</activeByDefault>
</activation>


но оно ничего не меняет. Буду рад помощи. Спасибо за ответы.

Ссылки:
http://appfuse.org/display/APF/AppFuse QuickStart
...
Рейтинг: 0 / 0
17.08.2013, 14:08:05
    #38369710
Dzib
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AppFuse change database profile
Поменял снизу помки
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
<!-- Database settings -->
		<dbunit.dataTypeFactoryName>org.dbunit.ext.mssql.MsSqlDataTypeFactory</dbunit.dataTypeFactoryName>
		<dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
		<hibernate.dialect>org.hibernate.dialect.SQLServerDialect</hibernate.dialect>
		<jdbc.groupId>net.sourceforge.jtds</jdbc.groupId>
		<jdbc.artifactId>jtds</jdbc.artifactId>
		<jdbc.version>1.2</jdbc.version>
		<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
		<jdbc.url>dbc:jtds:sqlserver://localhost:1433/${db.name};useUnicode=true;characterEncoding=UTF-8</jdbc.url>
		<jdbc.username>db083</jdbc.username>
		<jdbc.password>db083</jdbc.password>


Теперь:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
ERROR [main] SchemaExport.execute(274) | schema export unsuccessful
java.sql.SQLException: No suitable driver found for dbc:jtds:sqlserver://localhost:1433/my;useUnicode=true;characterEncoding=UTF-8
	at java.sql.DriverManager.getConnection(DriverManager.java:604)
	at java.sql.DriverManager.getConnection(DriverManager.java:190)
	at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
	at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:52)
	at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:252)
	at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:211)
	at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLExporterMojo.java:112)
	at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporterMojo.java:152)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[WARNING] 1 errors occurred while performing <hbm2ddl>.
[ERROR] Error #1: java.sql.SQLException: No suitable driver found for dbc:jtds:sqlserver://localhost:1433/my;useUnicode=true;characterEncoding=UTF-8
...
Рейтинг: 0 / 0
17.08.2013, 14:12:04
    #38369712
Dzib
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AppFuse change database profile
Опечатка была в jdbc, но это ничего не поменяло.
...
Рейтинг: 0 / 0
18.08.2013, 20:08:47
    #38370123
Dzib
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AppFuse change database profile
Проблема решена.

Снизе где:
Код: xml
1.
<!-- Database settings -->


Поменял на:
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
                <dbunit.dataTypeFactoryName>org.dbunit.ext.mssql.MsSqlDataTypeFactory</dbunit.dataTypeFactoryName>
		<dbunit.operation.type>MSSQL_CLEAN_INSERT</dbunit.operation.type>
		<hibernate.dialect>org.hibernate.dialect.SQLServerDialect</hibernate.dialect>
		<jdbc.groupId>net.sourceforge.jtds</jdbc.groupId>
		<jdbc.artifactId>jtds</jdbc.artifactId>
		<jdbc.version>1.2</jdbc.version>
		<jdbc.driverClassName>net.sourceforge.jtds.jdbc.Driver</jdbc.driverClassName>
		<jdbc.url><![CDATA[jdbc:jtds:sqlserver://localhost:1433/my]]></jdbc.url>
		<jdbc.username>083db</jdbc.username>
		<jdbc.password>083db</jdbc.password>
...
Рейтинг: 0 / 0
Форумы / Java [игнор отключен] [закрыт для гостей] / AppFuse change database profile / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]