{"id":21984659,"url":"https://github.com/mrts/local-ejb-injection","last_synced_at":"2026-04-19T17:05:40.486Z","repository":{"id":66661256,"uuid":"66669452","full_name":"mrts/local-ejb-injection","owner":"mrts","description":"Sample project demonstrating packaging EJB JARs and WARs into EAR","archived":false,"fork":false,"pushed_at":"2016-08-26T18:17:48.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T05:14:17.723Z","etag":null,"topics":["ear","ejb","ejb-jar","servlet","war"],"latest_commit_sha":null,"homepage":null,"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/mrts.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-26T18:13:40.000Z","updated_at":"2024-08-22T19:50:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"b99f8d57-f5fa-4c77-92f8-8b990e268fb2","html_url":"https://github.com/mrts/local-ejb-injection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrts%2Flocal-ejb-injection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrts%2Flocal-ejb-injection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrts%2Flocal-ejb-injection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrts%2Flocal-ejb-injection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrts","download_url":"https://codeload.github.com/mrts/local-ejb-injection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245044493,"owners_count":20551898,"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":["ear","ejb","ejb-jar","servlet","war"],"created_at":"2024-11-29T18:10:39.500Z","updated_at":"2026-04-19T17:05:40.456Z","avatar_url":"https://github.com/mrts.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# local-ejb-injection\n\nThis is a sample project demonstrating injecting EJBs from EJB JARs into web\napplications packaged as WARs inside a master EAR.\n\nHere's how the result looks:\n\n    application-ear.ear\n    ├── service-ejb-impl.jar\n    ├── web-application.war\n    ├── lib\n    │   └── service-ejb-api.jar\n    └── META-INF\n        ├── MANIFEST.MF\n        └── application.xml\n\nHere’s a usage scenario:\n\nYou have a web application packaged as a WAR that needs to use EJB services\nthat cannot be packaged into the WAR as they are used by other WARs in the EAR.\nYou annotate the service interface with `@Local`, extract it into a separate\nAPI JAR and reference the API JAR from both the WAR and EAR projects. Then you\nimplement the service in an EJB JAR that is packaged into the EAR and inject\nthe interface with `@EJB` annotation as an instance field into a servlet in the\nWAR.\n\nIt’s a Maven project with the following modules:\n\n* *web-application* – servlet that calls the EJB service, open\n  \u003chttp://localhost:8080/web-application/hello\u003e to access it\n* *service-ejb-api* – service interface with `@Local` annotation\n* *service-ejb-impl* – `@Stateless` EJB that implements the service interface\n* *application-ear* – packages the EJB JAR into an EAR.\n\nBuild it with `mvn package` and deploy\n`application-ear/target/application-ear.ear` to the application server to run\nit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrts%2Flocal-ejb-injection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrts%2Flocal-ejb-injection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrts%2Flocal-ejb-injection/lists"}