Git Product home page Git Product logo

axon-trader's Introduction

Axon Framework logo

Axon Framework

Build modern event-driven systems with AxonIQ technology.
Product Description »

Code Samples Repo · Technical Overview · Feature / Bug Request

Axon Framework

Maven Central Build Status SonarCloud Status

Axon Framework is a framework for building evolutionary, event-driven microservice systems based on the principles of Domain-Driven Design (DDD), Command-Query Responsibility Separation (CQRS), and Event Sourcing.

Bootstrap logo

Axon Framework provides you with the necessary building blocks to follow these principles. Examples of building blocks are aggregate design handles, aggregate repositories, command buses, saga design handles, event stores, query buses, and more. The framework provides sensible defaults for all of these components out of the box.

The messaging support for commands, events, and queries is at the core of these building blocks. It is the messaging basics that enable an evolutionary approach towards microservices through the location transparency they provide.

Axon will also assist in distributing applications to support scalability or fault tolerance, for example. The most accessible and quick road forward would be to use Axon Server to seamlessly adjust message buses to distributed implementations. Axon Server provides a distributed command bus, event bus, query bus, and an efficient event store implementation for scalable event sourcing. Additionally, the Axon Framework organization has several extensions that can help in this space.

All this helps to create a well-structured application without worrying about the infrastructure. Hence, your focus can shift from non-functional requirements to your business functionality.

For more information on anything Axon, please visit our website, http://axoniq.io.

Getting started

Numerous resources can help you on your journey in using Axon Framework. A good starting point is AxonIQ Developer Portal, which provides links to resources like blogs, videos, and descriptions.

Furthermore, below are several other helpful resources:

  • The quickstart page of the documentation provides a simplified entry point into the framework with the quickstart project.
  • We have our very own academy! The introductory courses are free, followed by more in-depth (paid) courses.
  • When ready, you can quickly and easily start your very own Axon Framework based application at https://start.axoniq.io/. Note that this solution is only feasible if you want to stick to the Spring ecosphere.
  • The reference guide explains all of the components maintained within Axon Framework's products.
  • If the guide doesn't help, our forum provides a place to ask questions you have during development.
  • The hotel demo shows a fleshed-out example of using Axon Framework.
  • The code samples repository contains more in-depth samples you can benefit from.

Receiving help

Are you having trouble using any of our libraries or products? Know that we want to help you out the best we can! There are a couple of things to consider when you're traversing anything Axon:

  • Checking the reference guide should be your first stop.
  • When the reference guide does not cover your predicament, we would greatly appreciate it if you could file an issue for it.
  • Our forum provides a space to communicate with the Axon community to help you out. AxonIQ developers will help you out on a best-effort basis. And if you know how to help someone else, we greatly appreciate your contributions!
  • We also monitor Stack Overflow for any question tagged with axon. Similarly to the forum, AxonIQ developers help out on a best-effort basis.

Feature requests and issue reporting

We use GitHub's issue tracking system) for new feature requests, framework enhancements, and bugs. Before filing an issue, please verify that it's not already reported by someone else. Furthermore, make sure you are adding the issue to the correct repository!

When filing bugs:

  • A description of your setup and what's happening helps us figure out what the issue might be.
  • Do not forget to provide the versions of the Axon products you're using, as well as the language and version.
  • If possible, share a stack trace. Please use Markdown semantics by starting and ending the trace with three backticks (```).

When filing a feature or enhancement:

  • Please provide a description of the feature or enhancement at hand. Adding why you think this would be beneficial is also a great help to us.
  • (Pseudo-)Code snippets showing what it might look like will help us understand your suggestion better. Similarly as with bugs, please use Markdown semantics for code snippets, starting and ending with three backticks (```).
  • If you have any thoughts on where to plug this into the framework, that would be very helpful too.
  • Lastly, we value contributions to the framework highly. So please provide a Pull Request as well!

axon-trader's People

Contributors

abuijze avatar bliessens avatar jettro avatar jkallen avatar jkuipers avatar johnament avatar pillopl avatar smcvb avatar tomsoete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

axon-trader's Issues

User uniqueness test missing

In the architecture wiki document you state that:

One important part for the users of the system is that the username's must be unique. When receiving a command to create a new user, we first check against a special collection to see if the username is still available. After validation we actually create the user.

However, I cannot find that check in the code, and I can easily create a test that attempt to create two users with the same username.

    @Test
    public void testHandleCreateUserTwice() throws Exception {
        UserId aggregateIdentifier = new UserId();

        UserEntry userEntry = new UserEntry();
        userEntry.setUsername("buyer1");
        userEntry.setIdentifier(aggregateIdentifier.toString());
        userEntry.setName("Buyer One");
        Mockito.when(userQueryRepository.findByUsername("buyer1")).thenReturn(userEntry);

        fixture.given(new UserCreatedEvent(aggregateIdentifier, "Buyer 1", "buyer1", DigestUtils.sha1("buyer1")))
                .when(new CreateUserCommand(aggregateIdentifier, "Buyer 1", "buyer1", "buyer1"))
                .expectEvents();
    }

The test gives:

-------------------------------------------------------------------------------
Test set: org.axonframework.samples.trader.app.command.user.UserCommandHandlerTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.355 sec <<< FAILURE!
testHandleCreateUserTwice(org.axonframework.samples.trader.app.command.user.UserCommandHandlerTest)  Time elapsed: 0.298 sec  <<< FAILURE!
org.axonframework.test.AxonAssertionError: The published events do not match the expected events

Expected  |  Actual
----------|----------
         <|> org.axonframework.samples.trader.api.users.UserCreatedEvent

Update Application to Axon Framework best practices

For Axon Framework users it's beneficial to see an Axon Framework application which follows (what we regard) the best practices of such an application.
This work will thus entail stuff like:

  • Updating most/all versions to the latest, especially the framework version.
  • Incorporate Kotlin for the core-api module, as this provides a more concise solution for immutable objects.
  • Introduce @QueryHandler annotated functions to Query Handling Components.
  • Move the @CommandHandler annotations to the Aggregates i.o. a separate Command Handling Component.
  • Use the @EventSourcingHandler annotation in Aggregates i.o. the @EventHandler annotation.
  • Steam line configuration classes by using several of the automatically created beans through a Spring Boot Axon application.
  • An overall style code update of all the classes.
  • And very likely, a whole bunch of other adjustments as well.

Exception while Buying

  1. Log in as buyer1
  2. Go to Companies
  3. Go to BP
  4. Click Buy
  5. Enter 1000 for price to trade and amount of items to trade
  6. Click place order
  7. Site redirects to company page, but no orders display.
  8. An exception is logged...here is the log.

Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.axonframework.samples:axon-trader-webui:war:0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ org.axonframework.samples:axon-trader:0.1-SNAPSHOT, C:\Development\Axon-trader\pom.xml, line 43, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Axon Trader Sample - Web ui 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.22:run (default-cli) @ axon-trader-webui >>>
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ axon-trader-webui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ axon-trader-webui ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ axon-trader-webui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Development\Axon-trader\web-ui\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ axon-trader-webui ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< maven-jetty-plugin:6.1.22:run (default-cli) @ axon-trader-webui <<<
[INFO]
[INFO] --- maven-jetty-plugin:6.1.22:run (default-cli) @ axon-trader-webui ---
[INFO] Configuring Jetty for project: Axon Trader Sample - Web ui
[INFO] Webapp source directory = C:\Development\Axon-trader\web-ui\src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = C:\Development\Axon-trader\web-ui\target\classes
[INFO] Context path = /
[INFO] Tmp directory = determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = C:\Development\Axon-trader\web-ui\src\main\webapp\WEB-INF\web.xml
[INFO] Webapp directory = C:\Development\Axon-trader\web-ui\src\main\webapp
[INFO] Starting jetty 6.1.22 ...
INFO - main - ContextLoader - Root WebApplicationContext: initialization started
INFO - main - licationContextInitializer - Activating the default profile within the application context.
INFO - main - XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Fri Jan 27 11:25:24 EST 2012]; root of context hierarchy
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/command-context.xml]
INFO - main - IdentifierFactory - No custom IdentifierFactory implementation found. Using default.
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/configuration-context.xml]
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/cqrs-infrastructure-context.xml]
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/persistence-infrastructure-context.xml]
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/security-context.xml]
INFO - main - SpringSecurityCoreVersion - You are running with Spring Security Core 3.1.0.RC3
INFO - main - SecurityNamespaceHandler - Spring Security 'config' module version is 3.1.0.RC3
INFO - main - curityMetadataSourceParser - Creating access control expression attribute 'isAnonymous() or isAuthenticated()' for /index.html
INFO - main - curityMetadataSourceParser - Creating access control expression attribute 'isAnonymous() or isAuthenticated()' for /data/**
INFO - main - curityMetadataSourceParser - Creating access control expression attribute 'hasRole('ROLE_USER')' for /**
INFO - main - curityBeanDefinitionParser - Checking sorted filter chain: [Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 300, Root bean: class [org.springframework.security.web.authentication.logout.LogoutFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 400, <org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0>, order = 800, Root bean: class [org.springframework.security.web.authentication.www.BasicAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1200, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1300, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1400, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1800, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1900, <org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0>, order = 2000]
INFO - main - urcesPlaceholderConfigurer - Loading properties file from class path resource [trader.properties]
INFO - main - XmlWebApplicationContext - Bean 'commandBus' of type [class org.axonframework.commandhandling.SimpleCommandBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO - main - XmlWebApplicationContext - Bean 'eventBus' of type [class org.axonframework.eventhandling.SimpleEventBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO - main - DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@817d6: defining beans [org.springframework.aop.config.internalAutoProxyCreator,companyCommandHandler,orderBookCommandHandler,portfolioCommandHandler,portfolioManagementUserListener,transactionCommandHandler,userCommandHandler,companyListener,orderBookListener,portfolioItemEventListener,portfolioMoneyEventListener,transactionEventListener,userListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.axonframework.eventsourcing.EventCountSnapshotterTrigger#0,orderBookRepository,org.axonframework.eventsourcing.EventCountSnapshotterTrigger#1,companyRepository,org.axonframework.eventsourcing.EventCountSnapshotterTrigger#2,userRepository,org.axonframework.eventsourcing.EventCountSnapshotterTrigger#3,portfolioRepository,org.axonframework.eventsourcing.EventCountSnapshotterTrigger#4,transactionRepository,snapshotter,taskExecutor,ehcache,org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,__axon-annotation-command-handler-bean-post-processor,__axon-annotation-event-listener-bean-post-processor,eventBus,commandBus,eventStore,sagaRepository,sagaManager,resourceInjector,companyQueryRepository,portfolioQueryRepository,userQueryRepository,transactionQueryRepository,orderBookQueryRepository,tradeExecutedQueryRepository,org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor#0,mongoSpringTemplate,mongoTemplate,mongoSagaTemplate,org.springframework.data.mongodb.core.MongoFactoryBean#0,mongoDbFactory,traderAuthenticationProvider,userController,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.web.DefaultSecurityFilterChain#1,org.springframework.security.web.DefaultSecurityFilterChain#2,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#3,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
WARN - main - ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Users/gibbensr/.m2/repository/net/sf/ehcache/ehcache-core/2.2.0/ehcache-core-2.2.0.jar!/ehcache-failsafe.xml
INFO - main - ThreadPoolTaskExecutor - Initializing ExecutorService 'taskExecutor'
INFO - main - efaultFilterChainValidator - Checking whether login URL '/login.jsp' is accessible with your configuration
INFO - main - ContextLoader - Root WebApplicationContext: initialization completed in 2182 ms
INFO - main - DispatcherServlet - FrameworkServlet 'dispatcher': initialization started
INFO - main - XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Fri Jan 27 11:25:27 EST 2012]; parent: Root WebApplicationContext
INFO - main - XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
INFO - main - DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f9f663: defining beans [adminController,companyController,dashboardController,DBInit,mongoController,orderBookController,traderAuthenticationProvider,userController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.beanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.config.viewControllerHandlerAdapter,org.springframework.web.servlet.config.viewControllerHandlerMapping,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#2,org.springframework.web.servlet.view.InternalResourceViewResolver#0,validator,messageSource,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@817d6
INFO - main - questMappingHandlerMapping - Mapped "{[/admin/portfolio],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.admin.AdminController.show(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/admin/portfolio/{identifier}/item],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.admin.AdminController.addItem(java.lang.String,java.lang.String,long)
INFO - main - questMappingHandlerMapping - Mapped "{[/admin/portfolio/{identifier}/money],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.admin.AdminController.addMoney(java.lang.String,long)
INFO - main - questMappingHandlerMapping - Mapped "{[/admin/portfolio/{identifier}],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.admin.AdminController.showPortfolio(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/company],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.get(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/company/{identifier}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.details(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/company/buy/{identifier}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.buyForm(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/company/sell/{identifier}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.sellForm(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/company/sell/{identifier}],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.sell(org.axonframework.samples.trader.webui.order.SellOrder,org.springframework.validation.BindingResult)
INFO - main - questMappingHandlerMapping - Mapped "{[/company/buy/{identifier}],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.companies.CompanyController.buy(org.axonframework.samples.trader.webui.order.BuyOrder,org.springframework.validation.BindingResult)
INFO - main - questMappingHandlerMapping - Mapped "{[/dashboard],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.dashboard.DashboardController.show(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/data/collection/{id}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.init.MongoController.collection(java.lang.String,int,int,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/data/collections],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.init.MongoController.collections(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/data/init],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.init.MongoController.initializeMongo(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/data/portfolio/money/{identifier}/{amount}],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.init.MongoController.addMoneyToPortfolio(java.lang.String,long,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/orderbook],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.order.OrderBookController.get(org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/orderbook/{identifier}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.order.OrderBookController.getOrders(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/user/{identifier}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.security.UserController.detail(java.lang.String,org.springframework.ui.Model)
INFO - main - questMappingHandlerMapping - Mapped "{[/user],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.axonframework.samples.trader.webui.security.UserController.showUsers(org.springframework.ui.Model)
INFO - main - SimpleUrlHandlerMapping - Mapped URL path [/index.html] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
INFO - main - SimpleUrlHandlerMapping - Mapped URL path [/js/] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
INFO - main - SimpleUrlHandlerMapping - Mapped URL path [/style/
] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1'
INFO - main - SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
INFO - main - DispatcherServlet - FrameworkServlet 'dispatcher': initialization completed in 9716 ms
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
ERROR - 19411967-4 - SimpleCommandBus - Processing of a [StartBuyTransactionCommand] resulted in an exception:
java.lang.ClassCastException: org.axonframework.domain.StringAggregateIdentifier cannot be cast to java.lang.String
at org.axonframework.saga.repository.mongo.AssociationValueEntry.(AssociationValueEntry.java:36)
at org.axonframework.saga.repository.mongo.MongoSagaRepository.storeAssociationValue(MongoSagaRepository.java:108)
at org.axonframework.saga.repository.AbstractSagaRepository.add(AbstractSagaRepository.java:89)
at org.axonframework.saga.repository.mongo.MongoSagaRepository.add(MongoSagaRepository.java:45)
at org.axonframework.saga.annotation.AnnotatedSagaManager.findSagas(AnnotatedSagaManager.java:122)
at org.axonframework.saga.annotation.AnnotatedSagaManager.findSagas(AnnotatedSagaManager.java:103)
at org.axonframework.saga.AbstractSagaManager$SagaLookupAndInvocationTask.run(AbstractSagaManager.java:227)
at org.axonframework.saga.SynchronousSagaExecutionWrapper.scheduleLookupTask(SynchronousSagaExecutionWrapper.java:29)
at org.axonframework.saga.AbstractSagaManager.handle(AbstractSagaManager.java:86)
at org.axonframework.eventhandling.SimpleEventBus.publish(SimpleEventBus.java:110)
at org.axonframework.unitofwork.DefaultUnitOfWork$EventEntry.publishEvent(DefaultUnitOfWork.java:249)
at org.axonframework.unitofwork.DefaultUnitOfWork.publishEvents(DefaultUnitOfWork.java:180)
at org.axonframework.unitofwork.DefaultUnitOfWork.doCommit(DefaultUnitOfWork.java:83)
at org.axonframework.unitofwork.AbstractUnitOfWork.commit(AbstractUnitOfWork.java:54)
at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:125)
at org.axonframework.commandhandling.SimpleCommandBus.dispatch(SimpleCommandBus.java:78)
at org.axonframework.samples.trader.webui.companies.CompanyController.buy(CompanyController.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:629)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:590)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:874)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:790)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:312)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:324)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Replace Jetty with Tomcat 8

In the past jetty integration with maven was a lot easier than Tomcat. Since we use tomcat for most of our projects, we prefer to use tomcat. We are going to move to Tomcat 8 for their web socket support.

query.users.UserEventHandler - No default constructor found

I downloaded the axon-trader demo today. When i run mvn tomcat7:run in the main folder, i get this error message:

INFORMATION: Initializing Spring root WebApplicationContext
ERROR - tartStop-1 - ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userEventHandler' defined in file [/Users/skipped/Downloads/Engineering/Java/AxonFramework/Demo/axon-trade/users-query/target/classes/org/axonframework/samples/trader/query/users/UserEventHandler.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.query.users.UserEventHandler]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.query.users.UserEventHandler.()
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.query.users.UserEventHandler]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.query.users.UserEventHandler.()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
... 22 more
Caused by: java.lang.NoSuchMethodException: org.axonframework.samples.trader.query.users.UserEventHandler.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 23 more
Jul 17, 2018 8:39:59 PM org.apache.catalina.core.StandardContext listenerStart

some question with axon

hi.I am very interested in axon.But I have some questions. i hope u can help me

  1. when i want create a new user, but, user name is unique . in the create command, should i to do something? what should i do?

Error creating bean with name 'companyOrderBookListener'

ERROR - tartStop-1 - ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyOrderBookListener' defined in file [D:\project\Axon-trader\companies\target\classes\org\axonframework\samples\trader\company\command\CompanyOrderBookListener.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.company.command.CompanyOrderBookListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.company.command.CompanyOrderBookListener.()
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.company.command.CompanyOrderBookListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.company.command.CompanyOrderBookListener.()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
... 22 more
Caused by: java.lang.NoSuchMethodException: org.axonframework.samples.trader.company.command.CompanyOrderBookListener.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 23 more

Favicon error

After logging in, I'm redirected to http://localhost:8080/favicon.ico which shows

HTTP ERROR 404

Problem accessing /favicon.ico. Reason:

NOT_FOUND

Manually navigating back to the home page works, and I'm logged in, but it's a disconcerting error.

Correct Use Of Aggregate's Execute And Handle Methods

Hi!

I would like to clarify some points of using repositories and aggregates.
What I see from javadoc for the execute and handle methods:

* Note that the use of this method is not recommended as the wrapped aggregate instance is not meant to be
* exposed. Relying on this method is commonly a sign of design smell.

However, I see them used in this sample project, for instance in CompanyCommandHandler, line 46:

Aggregate<Company> company = repository.load(command.getCompanyId().toString());

company.execute(aggregateRoot -> aggregateRoot.addOrderBook(command.getOrderBookId()));

So is this ok to to use them in such way?

when ran sample it throws error

I deploy sample into tomcat, it throws error

INFO - tartStop-1 - licationContextInitializer - Activating the default profile
within the application context.
ERROR - tartStop-1 - ContextLoader - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Config
uration problem: URL must not be null
Offending resource: class path resource [META-INF/spring/persistence-infrastruct
ure-context.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
or(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:76)
at org.springframework.data.repository.config.AbstractRepositoryConfigDe
finitionParser.handleError(AbstractRepositoryConfigDefinitionParser.java:158)
at org.springframework.data.repository.config.AbstractRepositoryConfigDe
finitionParser.parse(AbstractRepositoryConfigDefinitionParser.java:87)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(N
amespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1419)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1409)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe
rBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
at org.springframework.context.support.AbstractApplicationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:522)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:436)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebA
pplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:4738)
at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5158)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
15-Feb-2014 12:27:50.466 SEVERE [localhost-startStop-1] org.apache.catalina.core
.StandardContext.startInternal Error listenerStart
15-Feb-2014 12:27:50.610 INFO [localhost-startStop-1] org.apache.catalina.util.S
essionIdGenerator.createSecureRandom Creation of SecureRandom instance for sessi
on ID generation using [SHA1PRNG] took [127] milliseconds.
15-Feb-2014 12:27:50.613 SEVERE [localhost-startStop-1] org.apache.catalina.core
.StandardContext.startInternal Context [/axon-trader-webui-0.1-SNAPSHOT] startup
failed due to previous errors
WARN - tartStop-1 - XmlWebApplicationContext - Exception thrown from Applicat
ionListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c
all 'refresh' before multicasting events via the context: Root WebApplicationCon
text: startup date [Sat Feb 15 12:27:48 CST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApp
licationEventMulticaster(AbstractApplicationContext.java:337)
at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:324)
at org.springframework.context.support.AbstractApplicationContext.doClos
e(AbstractApplicationContext.java:1025)
at org.springframework.context.support.AbstractApplicationContext.close(
AbstractApplicationContext.java:988)
at org.springframework.web.context.ContextLoader.closeWebApplicationCont
ext(ContextLoader.java:556)
at org.springframework.web.context.ContextLoaderListener.contextDestroye
d(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext
.java:4779)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext
.java:5372)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
WARN - tartStop-1 - XmlWebApplicationContext - Exception thrown from Lifecycl
eProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refr
esh' before invoking lifecycle methods via the context: Root WebApplicationConte
xt: startup date [Sat Feb 15 12:27:48 CST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLif
ecycleProcessor(AbstractApplicationContext.java:350)
at org.springframework.context.support.AbstractApplicationContext.doClos
e(AbstractApplicationContext.java:1033)
at org.springframework.context.support.AbstractApplicationContext.close(
AbstractApplicationContext.java:988)
at org.springframework.web.context.ContextLoader.closeWebApplicationCont
ext(ContextLoader.java:556)
at org.springframework.web.context.ContextLoaderListener.contextDestroye
d(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext
.java:4779)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext
.java:5372)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
15-Feb-2014 12:27:50.706 SEVERE [localhost-startStop-1] org.apache.catalina.load
er.WebappClassLoader.clearReferencesThreads The web application [/axon-trader-we
bui-0.1-SNAPSHOT] appears to have started a thread named [FileWatchdog] but has
failed to stop it. This is very likely to create a memory leak.

Remove cloudfoundry things

Cloudfoundry does not support free hosting anymore, therefore we remove the classes needed for cloud foundry.

No Default constructor in PortfolioManagementUserListener

I am getting this error. I have tried to run it multiple times and after reading the documentation too.
I am missing something ? i am not able to see any pages at 8080. Please comment if you are able to run or any of the branches are working.

I downloaded the project . went into Axon-trader folder and run mvn tomcat7:run



ERROR - tartStop-1 - ContextLoader              - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'portfolioManagementUserListener' defined in file [/home/ranajit/microservices/saga/Axon-trader/orders/target/classes/org/axonframework/samples/trader/orders/command/PortfolioManagementUserListener.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
	... 22 more
Caused by: java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at java.lang.Class.getConstructor0(Class.java:3082)
	at java.lang.Class.getDeclaredConstructor(Class.java:2178)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
	... 23 more
Jul 31, 2018 2:42:09 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'portfolioManagementUserListener' defined in file [/home/ranajit/microservices/saga/Axon-trader/orders/target/classes/org/axonframework/samples/trader/orders/command/PortfolioManagementUserListener.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
	... 22 more
Caused by: java.lang.NoSuchMethodException: org.axonframework.samples.trader.orders.command.PortfolioManagementUserListener.<init>()
	at java.lang.Class.getConstructor0(Class.java:3082)
	at java.lang.Class.getDeclaredConstructor(Class.java:2178)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
	... 23 more

Jul 31, 2018 2:42:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jul 31, 2018 2:42:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Jul 31, 2018 2:42:09 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Jul 31, 2018 2:42:09 PM org.apache.catalina.core.ApplicationContext log
INFO: Shutting down log4j
Jul 31, 2018 2:42:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [org.hsqldb.jdbc.JDBCDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jul 31, 2018 2:42:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak.
Jul 31, 2018 2:42:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]

Classes missing

below classes are missing

import org.axonframework.samples.trader.api.orders.transaction.TransactionId;
import org.axonframework.samples.trader.api.orders.transaction.ConfirmTransactionCommand;

Doesn't build on Maven 3.3

The enforcer plugin currently restricts building on 3.3. It's pretty common now and there's no issues building.

mvn tomcat7:run will not start application

after clone master branch and launching mvn tomcat7:run

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
...
Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsSci cannot be cast to javax.servlet.ServletContainerInitializer at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1670) at org.apache.catalina.startup.ContextConfig.getServletContainerInitializers(ContextConfig.java:1652) at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 6 more

axonframework snapshot repository missing in pom

Can't compile because i do not have 1.3-Snapshot

Could not resolve dependencies for project org.axonframework.samples:axon-trader-app:jar:0.1-SNAPSHOT: The following artifacts could not be resolved: org.axonframework:axon-core:jar:1.3-SNAPSHOT, org.axonframework.incubator:axon-mongo:jar:1.3-SNAPSHOT, org.axonframework:axon-test:jar:1.3-SNAPSHOT: Could not find artifact org.axonframework:axon-core:jar:1.3-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

Upgrade to java 7

Upgrade the pom and maybe change some of the code to use java 7 constructs.

Refactor the OrderBook / Company relationship

Within the sample the idea is that a company can have multiple order books. At the moment this is not really the case. The order book is correlated to the company, they share the same identifier.

We want to refactor this to a solution where the relation ship between an order book and a company is taken care of within the company context.

how to use mongo db

when start with mvn tomcat7:run, the hsql is used. How can I switch to mongo db?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.