Einsatz von Komponenten in JEE am Beispiel von IMIXS the open source workflow technology Ralph.Soika@imixs.com Imixs Software Solutions GmbH Best IBM Lotus Sametime Collaboration Extension Imixs Software Solutions GmbH Nordendstr. 2, 80799 München Tel.: +49(89) 45 21 36 0 http://www.imixs.com http://www.imixs.org 12.09.10 Imixs 1
Agenda Warum Komponenten? Deployment von EJB Komponenten in Java EE 6 Diskussion 12.09.10 Imixs 2
Die Angst vor Java EE... EJB WEB Modul JAAS JNDI Deployment EJB light Transaction JPA JPQL Java EE ist eine Komponenten Architektur Java EE applications are made up of components. A Java EE component is a selfcontained functional software unit that is assembled into a Java EE application with its related classes and files and communicates with other components. 12.09.10 Imixs 3
Was ist eine Komponente? Eine Software Komponente ist ein Software Element, das konform zu einem Komponentenmodell ist und gemäß einem Composition Standard ohne Änderungen mit anderen Komponenten verknüpft und ausgeführt werden kann. Eine Komponente zeichnet sich also dadurch aus, dass sie ein Element einer komponentenbasierten Anwendung darstellt und definierte Schnittstellen zur Verbindung mit anderen Komponenten besitzt. Ohne Änderung ausführbar Konfigurierbar Verknüpfbarkeit Hohe Wiederverwendbarkeit 12.09.10 Imixs 4
JEE Roles Reusable modules make it possible to divide the application development and deployment process into distinct roles so different people or companies can perform different parts of the process. Application Component Provider The application component provider is the company or person who creates web components, enterprise beans, applets, or application clients for use in J2EE applications.? Application Assembler The application assembler is the person who gets application components and assembles them into a application EAR file. The assembler or deployer can edit the deployment descriptor directly or use tools that correctly add XML tags according to interactive selections. Entwickler 12.09.10 Imixs 5
Beispiel Imixs JEE Components The Imixs JEE is a full featured Management System (WFMS) based on the JEE specification. The project extends the Imixs API project to fulfill the requirements to a scalable, transactional, robust and simple deployable Java EE System. Definition und Verwaltung von Modellen Erstellen, Ausführen und Persistierung von Prozessinstanzen Bereitstellen von Aufgaben und Statuslisten Zugriffsmanagement einer Prozessinstanz Prozessdokumentation compliance Funktionen Archivierung, Versionierung 12.09.10 Imixs 6
Imixs JEE Components Architektur JPA Komponente Entity Beans Java Persistence Service Interfaces EJB Komponente Session Beans Implementierung Business Logic Web SOAP REST XML 12.09.10 Imixs 7
Java EE 6 Komponenten Deployment EAR / + META INF/ application.xml my_ejb_module.jar my_web_module.war EAR mit externen Komponenten / + META INF/ application.xml my_ejb_module.jar my_web_module.war imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar 12.09.10 Imixs 8
Java EE 6 Komponenten Deployment EAR mit externen Komponenten / + META INF/ application.xml + my_ejb_module.jar ejb jar.xml sun ejb jar.xml persistence.xml my_web_module.war imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar @annotations!! no deployment descriptor! 12.09.10 Imixs 9
Java EE 6 Komponenten Deployment INFO: [AutoDeploy] Selecting file /opt/glassfishv3/glassfish/domains/domain1/autodeploy/imixs workflow jsf sampleear 0.0.2 SNAPSHOT.ear for autodeployment. SCHWERWIEGEND: Class [ Lorg/imixs/workflow/jee/ejb/EntityService; ] not found. Error while loading [ class org.imixs.workflow.jee.soap.modelwebservicebean ] WARNUNG: Error in annotation processing: java.lang.noclassdeffounderror: Lorg/imixs/workflow/jee/ejb/EntityService; SCHWERWIEGEND: Class [ Lorg/imixs/workflow/jee/ejb/Service; ] not found. Error while loading [ class org.imixs.workflow.jee.rest.jaxrs.service ] WARNUNG: Error in annotation processing: java.lang.noclassdeffounderror: Lorg/imixs/workflow/jee/ejb/Service; SCHWERWIEGEND: Exception while deploying the app java.lang.illegalargumentexception: Referencing error: This bundle has no bean of name [EntityServiceBean] 12.09.10 Imixs 10
Java EE 6 Komponenten Deployment EAR mit externen Komponenten / + META INF/ application.xml + my_ejb_module.jar ejb jar.xml sun ejb jar.xml persistence.xml my_web_module.war imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar 12.09.10 Imixs 11
Java EE 6 Komponenten Deployment EAR mit externen Komponenten / + META INF/ application.xml + lib/ imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar + my_ejb_module.jar ejb jar.xml sun ejb jar.xml persistence.xml my_web_module.war 12.09.10 Imixs 12
Java EE 6 Komponenten Deployment SCHWERWIEGEND: Cannot resolve reference Remote ejb ref name=org.imixs.demo.app.appserviceonebean/demoservicesecond,remote 3.x interface =org.imixs.demo.demoservicesecond,ejb link=null,lookup=null,mappedname=,jndiname=,reftype=session because there are 2 ejbs in the application with interface org.imixs.demo.demoservicesecond SCHWERWIEGEND: Exception while deploying the app java.lang.runtimeexception: Cannot resolve reference Remote ejb ref name=org.imixs.demo.app.appserviceonebean/demoservicesecond,remote 3.x interface =org.imixs.demo.demoservicesecond,ejb link=null,lookup=null,mappedname=,jndiname=,reftype=session because there are 2 ejbs in the application with interface org.imixs.demo.demoservicesecond at com.sun.enterprise.deployment.util.ejbbundlevalidator.accept(ejbbundlevalidator.ja va:569)... 12.09.10 Imixs 13
Java EE 6 Komponenten Deployment EAR mit externen Komponenten / + META INF/ application.xml + lib/ imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar + my_ejb_module.jar ejb jar.xml sun ejb jar.xml persistence.xml my_web_module.war Not allowed! No Entity or EJBs! 12.09.10 Imixs 14
Java EE 6 Komponenten Deployment EAR mit externen Komponenten / + META INF/ application.xml Manifest Version: 1.0 + my_ejb_module.jar Class Path: imixs workflow jee impl 2.1.0.jar ejb jar.xml imixs workflow jee 2.1.0.jar sun ejb jar.xml persistence.xml MANIFEST.MF my_web_module.war imixs workflow jee 2.1.0.jar imixs workflow jee impl 2.1.0.jar 12.09.10 Imixs 15
Weitere Quellen im Internet: http://www.imixs.org http://doc.imixs.org/jee/deployment.html http://www 02.imixs.com/roller/ralphsjavablog/entry/jee6_and_packaging_an_ear http://forums.java.net/jive/thread.jspa?messageid=382643 noch Fragen? 12.09.10 Imixs 16