{"id":21432122,"url":"https://github.com/lookfirst/fallback","last_synced_at":"2025-07-14T12:32:47.271Z","repository":{"id":1507910,"uuid":"1764173","full_name":"lookfirst/fallback","owner":"lookfirst","description":"A good basis for spring framework projects running on top of tomcat. Uses simple configuration to highlight many of the features one would expect from a Java Application Server.","archived":false,"fork":false,"pushed_at":"2015-03-24T18:32:51.000Z","size":20924,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T08:51:38.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://lookfirst.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lookfirst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-18T03:02:00.000Z","updated_at":"2018-09-11T06:10:37.000Z","dependencies_parsed_at":"2022-08-16T13:31:04.306Z","dependency_job_id":null,"html_url":"https://github.com/lookfirst/fallback","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lookfirst/fallback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Ffallback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Ffallback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Ffallback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Ffallback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lookfirst","download_url":"https://codeload.github.com/lookfirst/fallback/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Ffallback/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265291943,"owners_count":23741943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T23:16:35.293Z","updated_at":"2025-07-14T12:32:45.771Z","avatar_url":"https://github.com/lookfirst.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"fallback\n========\n\n# This project is very old now. If you want something more modern and actively maintained, I suggest you look at [GWizard](https://github.com/gwizard/gwizard) instead.\n\nfallback provides a nice example web application archive (war) for\nintegrating Spring / Hibernate / JMX / JPA / Ehcache.\n\nIn order to come up with this clean of an integration, there is a ton of\nconflicting blog postings and documentation you would have to sift\nthrough. My goal here is to do that work for you and provide a nice\nbasis for starting from. The project is up on github in the hopes that\nyou will fork it and make improvements yourself.\n\nThe fallback project itself is a very basic 3-tier web application with\na RESTful servlet frontend that takes a request and calls a method on an\n`@Inject`ed bean which contains the business logic. If you are coming from\nEJB3 experience, this will look very familiar. Annotations are used as\nmuch as possible to simplify the Spring configuration.\n\nfallback will work with any modern servlet engine that supports api \u003e=\n2.5. By default, it is setup to work most easily with Tomcat 6/7, but\nyou can easily target the build script to point at your favorite\ncontainer.\n\nPart of the beauty of this is that this fully functional system is up\nand running on Tomcat in about 3 seconds on my laptop.\n\nDatabase Access\n---------------\nBy example, access to the database is managed through the standard\nDAO/Entity pattern. There is also an example of how to use an\nEntityManager if you want to go that route instead. The `BaseDAO`\nimplementation enables hibernate query caching with Ehcache. Adding \n`@Cache` to an entity enables fast lookups of objects.\n\nBasic transactions, `set autocommit=0; do work(); set autocommit=1` are\nalso fully supported in the business logic bean by adding an\n`@Transactional` annotation. If an exception is thrown, the final\nautocommit isn't executed. Enabling JTA is possible, but out of the\nscope of this project.\n\nJMX\n---\nFor JMX, the `JmxAgent` class registers both Ehcache and Hibernate with\nthe `MBeanServer` that is setup through Spring. Using the\n`@ManagedResource` `@ManagedOperation` and `@ManagedAttribute`\nannotations on a bean automatically exposes classes, methods and\nproperties via JMX. No need for over expressive XML configuration for\nyour beans. There is a logging manager class which allows you to set\nlogging to debug or info with the click of a button in jconsole.\n\nBuild System\n------------\nThe build system for this project doesn't use Maven. Instead we use a\nmore simple solution called\n[Sweetened](http://sweetened.googlecode.com), which is based on top of\nAnt. All of the jars that the project needs are located in the lib\ndirectory. This ensures that over time the project can be built\nregardless of the state of it. Sweetened is also responsible for\nbuilding the Eclipse .classpath and .project files.\n\nThere you have it. Please poke around the code and if you have questions\nfeel free to ask me.\n\nGetting Started\n---------------\n\n1. Clone this project: git clone \n2. Install tomcat6 somewhere (you can use any modern servlet engine)\n3. cd fallback; echo \"engine.home=/path/to/tomcat6_or_7\" \u003e user.properties\n4. ant .eclipse\n\nThe .eclipse target will generate a .project and .classpath file\nfor you so that you can load it easily into Eclipse.\n\n1. Right click in the Project Explorer\n2. Import...\n3. Import existing project into workspace\n4. Select the fallback directory.\n5. Go\n\nNow build the project:\n\n    ant all\n\nThis will copy an exploded war directory into your tomcat6 webapps\ndirectory.\n\n### MySQL\n\nBefore you can start up Tomcat, you need a MySQL database called\n'fallback' and accessible on localhost by user root with no password.\n\n    mysqladmin -u root create fallback\n\nIf you want to change any of this before you start up Tomcat, just edit\nthe database connection settings in the `web/WEB-INF/applicationContext.xml` \nfile. Integrating with Spring's `PropertyOverrideConfigurer` bean makes\n'environment' based settings easy.\n\nThe `persistence.xml` file is configured to auto create the table and\nall of the columns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookfirst%2Ffallback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flookfirst%2Ffallback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookfirst%2Ffallback/lists"}