auction sample issue

Hello!

I'm trying to get the auction sample run and followed the instructions
in "getting started".
No error messages from starting the infrastructure.

Starting the auction-client-test leads to:

<error message="java.sql.SQLSyntaxErrorException: Schema 'QUERYSERVER'
does not exist" type="java.lang.RuntimeException">
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Schema
'QUERYSERVER' does not exist
  at
org.fuin.auction.client.test.AbstractUseCaseTest.deleteAllDatabaseData(AbstractUseCaseTest.java:
74)
[...]

I checked the derby-database with ij: there is indeed no schema. I
assume that auction-query-server should have built up a schema in th
database, but I could not find the location in the sources, where this
actually happens.

Trying to display the service (displaying "http://localhost:8080/
auction-query-server-0.2.0-SNAPSHOT" in the webbowser) leads to
another error message:

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'connectionFactory' defined in class path
resource [jms-context.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0'
defined in class path resource [application-context.xml]: Cannot
resolve reference to bean 'txInterceptor' while setting bean property
'transactionInterceptor'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'txInterceptor' defined in class path resource
[application-context.xml]: Cannot resolve reference to bean
'txManager' while setting bean property 'transactionManager'; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'txManager' defined in class path
resource [application-context.xml]: Cannot resolve reference to bean
'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in class path
resource [application-context.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError: Could not
initialize class org.fuin.auction.query.server.AuctionUser
[...]

There seems to be an issue with spring-framework-classes not finding
the classes of auction-query-server. Since I'm very new to spring-
framework I appreciate any help or pointer to the right direction.

Emre

Hi Emre,

Looks like the infrastructure has not started correctly.

The database is created as a sub folder of the current directory. If
you started from Eclipse in the "Infrastructure" project it's located
in the project directory. Did everything build correctly using the
Maven builds? Any mesages on the console when starting the
infrastructure?

Cheers,
Michael

Hallo Michael,

thank you for your quick reply!

I'm using the command line to start the infrastructure-project since
trying to use the provided launchfiles in eclipse leaded to the
message: "Referenced classpath provider does not exist:
org.maven.ide.eclipse.launchconfig.classpathprovider". (I tried both
eclipse-maven-plugins from http://maven.apache.org/eclipse-plugin.html)

When I start the infrastructure with:

mvn exec:java -
Dexec.mainClass="org.fuin.auction.infrastructure.InfrastructureStart"

both directories: activemy-data and derby-data are created in the
project-folder.
the database is present and connectable. should the infrastructure
also create the schema/tables?

the output is:

[INFO] Scanning for projects...
[INFO]
[INFO]

Hi Emre,

should the infrastructure also create the schema/tables?

No, the tables are created when starting the query server.

The console looks good so far.

Do you have any errors starting the command and the query server after
the infrastructure is up and running?

Cheers,
Michael

Tipp: Be sure you execute the shutdown application in the
infrastructure to close all open files. Otherwise next start may show
errors (In this case simply delete the ActiveMQ and Derby directories
and try again).

Hello Michael,

I set up tomcat and building sources anew, to be sure that everything
is clean.

The tomcat logfile localhost.log told me, that a class in emma.jar was
missing, for the query-service.
I copied it into the "tomcat/lib" directory.
I made a step further: The queryserver-database is beeing created now,
but the commandserver-database is not.

the logfile(localhost.log) says:

24.05.2011 13:18:21 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'command'
24.05.2011 13:18:23 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'query'
24.05.2011 13:18:26 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
24.05.2011 13:18:26 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

The catalina-logfile doesn't show an error either.

24.05.2011 13:18:20 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
24.05.2011 13:18:20 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].
24.05.2011 13:18:20 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
24.05.2011 13:18:20 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
24.05.2011 13:18:20 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 535 ms
24.05.2011 13:18:20 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
24.05.2011 13:18:20 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
24.05.2011 13:18:20 org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
24.05.2011 13:18:21 org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor manager.xml
24.05.2011 13:18:21 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive auction-command-server-0.2.0-
SNAPSHOT.war
24.05.2011 13:18:23 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive auction-query-server-0.2.0-
SNAPSHOT.war
24.05.2011 13:18:25 org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory docs
24.05.2011 13:18:25 org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory examples
24.05.2011 13:18:26 org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory ROOT
24.05.2011 13:18:26 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
24.05.2011 13:18:26 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
24.05.2011 13:18:26 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5255 ms

starting the "auction-client-test"-testcase gives me the following
surefire-report:
<error message="java.sql.SQLSyntaxErrorException: Schema
'COMMANDSERVER' does not exist" type="java.lang.RuntimeException">
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Schema
'COMMANDSERVER' does not exist at
org.fuin.auction.client.test.AbstractUseCaseTest.deleteAllDatabaseData(AbstractUseCaseTest.java:
74) at
org.fuin.auction.client.test.CategoryUseCaseTest.testCategoryLifeCycle(CategoryUseCaseTest.java:
39) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [...]

I checked derby-db with ij to veryfiy that the commandserver-schema is
not there.
Hope you can find the missing part.

Thanks alot!

Emre

Hi!

The tomcat logfile localhost.log told me, that a class in emma.jar was
missing, for the query-service.
I copied it into the "tomcat/lib" directory.

This is strange. ECL EMMA is just for test purposes. Seems as if
building the app from command line has problems with it. I'll check
that later.

I made a step further: The queryserver-database is beeing created now,
but the commandserver-database is not.

Hmmm... You must run the
http://code.google.com/p/axon-auction-example/source/browse/trunk/auction-command-server/src/main/sql/create-db.sql
script to create the command server tables. This point was missing in
the Getting Started document (I added it now).

I hope everything works now.

Cheers,
Michael

Hello!

That's it, now everything (testcases/click-ui) works!

Things I had to modify to get the example working:

- skip the testcase "basetest" for building the sources, because Junit
cannot find a class named "package-info"
- remove the suffix "-0.2.0-SNAPSHOT" in the name of the war-files
- copy emma.jar into $tomcat-root/lib

Thanks a lot!

Emre

Hi Emre,

That's it, now everything (testcases/click-ui) works!

Good to hear it finally works :slight_smile:

Things I had to modify to get the example working:
- skip the testcase "basetest" for building the sources, because Junit
cannot find a class named "package-info"
- remove the suffix "-0.2.0-SNAPSHOT" in the name of the war-files
- copy emma.jar into $tomcat-root/lib

I'll check that and add things to the "Getting Started" if necessary.

I think I'll also create a VirtualBox VM that contains everything to
start completely without any installation. This would make it much
easier just to start the VM and try things out.

Cheers,
Michael