Tag: jbossas6

EJB Specific Deployment descriptors in WebLogic and JBoss

Hi,

An EJB container is the component that manages a particular class of EJB. In JBoss there is one instance of the org.jboss.ejb.Container created for each unique configuration of an EJB that is deployed. The actual object that is instantiated is a subclass of Container and the creation of the container instance is managed by the EJBDeployer MBean.

The JBoss EJB container architecture employs a modular plug-in approach. All key aspects of the EJB container may be replaced by custom versions of a plug-in and/or an interceptor by a developer. This approach allows for fine tuned customization of the EJB container behavior to optimally suite your needs. Most of the EJB container behavior is configurable through the EJB JAR META-INF/jboss.xml descriptor and the default server-wide equivalent standardjboss.xml descriptor.

In order to migrate the EJB based application from WebLogic to JBoss most of the peoplefaces challenges specially when it comes to the container specific deployment descriptors. So here in this example we will see what kind of entries goes inside the WebLogic specific EJB Deployment descriptor “weblogic-ejb-jar.xml” and how those parameter and configurations can be moved insside the JBoss specific EJB Deployment descriptors like “jboss.xml” (for JBoss AS4/5/6) and “jboss-ejb3.xml” (for JBoss AS7).

First of all we will see where to find the XSDs based on which we can write these JBoss specific deployment descriptors.

WebLogic XSDs

WebLogic Schemas are present inside : “${WLS_INSTALLATION}/modules/com.bea.core.descriptor.wl.binding_1.2.0.0.jar” file.

Location: “WLS1031/modules/com.bea.core.descriptor.wl.binding_1.2.0.0/META-INF/schemas/weblogic-ejb-jar.xsd”

JBoss XSDs

JBoss Schemas are present inside the ${JBOSS_HOME}/docs/schema/jboss_5_1.xsd (JBoss AS6 and earlier versions)

JBoss Schemas are present inside the ${JBOSS_HOME}/docs/schema/jboss-ejb3-2_0.xsd (JBoss AS7)

Here we will see with all the possible elements inside “weblogic-ejb-jar.xml” file how it looks :

Before Migration (weblogic-ejb-jar.xml)

<weblogic-ejb-jar id="{someID}" version="{someString}">
  <description>{someDescription}</description>
  <weblogic-enterprise-bean id="{someID}">
    <ejb-name>{someEjbName}</ejb-name>
    <transaction-descriptor id="{someID}">
      <trans-timeout-seconds>{someTxTimeout}</trans-timeout-seconds>
    </transaction-descriptor>
    <iiop-security-descriptor id="{someID}">
      <transport-requirements id="{someID}">
        <integrity id="{someID}">{someString}</integrity>
        <confidentiality id="{someID}">{someString}</confidentiality>
        <client-cert-authentication id="{someID}">{someString}</client-cert-authentication>
      </transport-requirements>
      <client-authentication id="{someID}">{someString}</client-authentication>
      <identity-assertion id="{someID}">{someString}</identity-assertion>
    </iiop-security-descriptor>
    <enable-call-by-reference>{some-true-false}</enable-call-by-reference>
    <network-access-point>{someString}</network-access-point>
    <clients-on-same-server>{some-true-false}</clients-on-same-server>
    <run-as-principal-name>{some-Role-Name}</run-as-principal-name>
    <create-as-principal-name id="{someID}">{someString}</create-as-principal-name>
    <remove-as-principal-name id="{someID}">{someString}</remove-as-principal-name>
    <passivate-as-principal-name id="{someID}">{someString}</passivate-as-principal-name>
    <jndi-name>{someJndiName}</jndi-name>
    <local-jndi-name>{someJndiName}</local-jndi-name>
    <dispatch-policy>{some-dispatch-policyType}</dispatch-policy>
    <remote-client-timeout>{someTxTimeout}</remote-client-timeout>
    <stick-to-first-server>{some-true-false}</stick-to-first-server>
  </weblogic-enterprise-bean>
  <security-role-assignment>{some-Role-Name}</security-role-assignment>
  <run-as-role-assignment>{some-Role-Name}</run-as-role-assignment>
  <security-permission>{some-security-permissionType}</security-permission>
  <transaction-isolation id="{someID}">
    <isolation-level id="{someID}">{someString}</isolation-level>
    <method id="{someID}">
      <description>{someDescription}</description>
      <ejb-name>{someEjbName}</ejb-name>
      <method-intf>{something}</method-intf>
      <method-name>{something}</method-name>
      <method-params>{something}</method-params>
    </method>
  </transaction-isolation>

  <message-destination-descriptor>{some-message-destination-descriptorType}</message-destination-descriptor>
  <idempotent-methods id="{someID}">
    <method id="{someID}">
      <description>{someDescription}</description>
      <ejb-name>{someEjbName}</ejb-name>
      <method-intf>{something}</method-intf>
      <method-name>{something}</method-name>
      <method-params>{something}</method-params>
    </method>
  </idempotent-methods>
  <retry-methods-on-rollback id="{someID}">
    <description>{someDescription}</description>
    <retry-count>{someTxTimeout}</retry-count>
    <method id="{someID}">
      <description>{someDescription}</description>
      <ejb-name>{someEjbName}</ejb-name>
      <method-intf>{something}</method-intf>
      <method-name>{something}</method-name>
      <method-params>{something}</method-params>
    </method>
  </retry-methods-on-rollback>
  <enable-bean-class-redeploy>{some-true-false}</enable-bean-class-redeploy>
  <timer-implementation id="{someID}">{someString}</timer-implementation>
  <disable-warning id="{someID}">{someString}</disable-warning>
  <work-manager>{something}</work-manager>
  <component-factory-class-name>{someString}</component-factory-class-name>
  <weblogic-compatibility id="{someID}">
    <entity-always-uses-transaction>{some-true-false}</entity-always-uses-transaction>
  </weblogic-compatibility>
</weblogic-ejb-jar>

After Migration (jboss.xml) to JBoss AS5/6

Now if we will try to migrate a weblogic based EJB Application to JBoss AS 5/6 then it will look something like following:

<jboss version="{someString}" metadata-complete="{true-false}" id="{someID}">
  <loader-repository>{someClassLoaderRepositoryName}</loader-repository>
  <jmx-name>{someJMXName}</jmx-name>
  <security-domain>{someSecurityDomainName}</security-domain>
  <missing-method-permissions-excluded-mode></missing-method-permissions-excluded-mode>
  <unauthenticated-principal></unauthenticated-principal>
  <jndi-binding-policy>{someStringJndiPolicy}</jndi-binding-policy>
  <jacc-context-id></jacc-context-id>
  <webservices id="{someID}">
    <context-root>{someStringValue}</context-root>
    <webservice-description>{some-webservice-descriptionType}</webservice-description>
  </webservices>
  <enterprise-beans>
  <service id="{someID}">
    <ejb-name>{someEJBName}</ejb-name>
    <mapped-name>{someMBeanObjectName}</mapped-name>
    <business-local>{someRemoteInterfaceEJBClass}</business-local>
    <business-remote>{someRemoteInterfaceEJBClass}</business-remote>
    <ejb-class>{someEJBClass}</ejb-class>
    <security-identity id="{someID}">
      <description>{someStringDescription}</description>
      <run-as-principal>{someRoleName}</run-as-principal>
    </security-identity>
    <object-name>{someJMXName}</object-name>
    <management></management>
    <xmbean></xmbean>
    <local-binding>
      <description>{someStringDescription}</description>
      <jndi-name>{someStringJndiPType}</jndi-name>
    </local-binding>
    <remote-binding id="{someID}">
      <description>{someStringDescription}</description>
      <jndi-name>{someStringJndiPType}</jndi-name>
      <client-bind-url></client-bind-url>
      <interceptor-stack></interceptor-stack>
      <proxy-factory></proxy-factory>
      <invoker-name></invoker-name>
    </remote-binding>
    <jndi-name>{someStringJndiPType}</jndi-name>
    <home-jndi-name>{someStringJndiPType}</home-jndi-name>
    <local-jndi-name>{someStringJndiPType}</local-jndi-name>
    <jndi-binding-policy>{someStringJndiPolicy}</jndi-binding-policy>
    <clustered></clustered>
    <cluster-config id="{someID}">
      <description>{someStringDescription}</description>
      <partition-name></partition-name>
      <home-load-balance-policy></home-load-balance-policy>
      <session-state-manager-jndi-name>{someStringValue}</session-state-manager-jndi-name>
    </cluster-config>
    <security-domain>{someMBeanObjectName}</security-domain>
    <method-attributes id="{someID}">
      <method id="{someID}">
        <method-name>{some-method-nameType}</method-name>
        <read-only>{some-boolean}</read-only>
        <idempotent>{some-boolean}</idempotent>
        <transaction-timeout></transaction-timeout>
      </method>
    </method-attributes>
    <depends>{someMBeanObjectName}</depends>
    <annotation id="{someID}">
      <description>{someStringDescription}</description>
      <annotation-class></annotation-class>
      <annotation-implementation-class></annotation-implementation-class>
      <injection-target>{someInjectionTarget}</injection-target>
      <property id="{someID}">
        <description>{someStringDescription}</description>
        <property-name>{someStringValue}</property-name>
        <property-value>{someStringValue}</property-value>
      </property>
    </annotation>
    <ignore-dependency id="{someID}">
      <description>{someStringDescription}</description>
      <injection-target>{someInjectionTarget}</injection-target>
    </ignore-dependency>
    <aop-domain-name></aop-domain-name>
    <pool-config>
      <pool-value></pool-value>
      <pool-max-size></pool-max-size>
      <pool-timeout></pool-timeout>
    </pool-config>
    <concurrent></concurrent>
    <jndi-ref id="{someID}">
      <description>{someStringDescription}</description>
      <jndi-ref-name>{someStringJndiPType}</jndi-ref-name>
    </jndi-ref>
    <port-component id="{someID}">
      <port-component-name>{someStringValue}</port-component-name>
      <port-component-uri>{someStringValue}</port-component-uri>
      <auth-method>{someStringValue}</auth-method>
      <transport-guarantee>{someStringValue}</transport-guarantee>
      <secure-wsdl-access>{some-boolean}</secure-wsdl-access>
    </port-component>
    <ejb-timeout-identity id="{someID}">
      <description>{someStringDescription}</description>
      <run-as-principal>{someRoleName}</run-as-principal>
    </ejb-timeout-identity>
  </service>
  </enterprise-beans>
  <assembly-descriptor id="{someID}">
    <security-role>{some-security-roleType}</security-role>
    <message-destination>{some-message-destinationType}</message-destination>
  </assembly-descriptor>
  <resource-managers id="{someID}">
    <description>{someStringDescription}</description>
    <resource-manager id="{someID}" res-class="{someStringValue}">
      <description>{someStringDescription}</description>
      <res-name>{someMBeanObjectName}</res-name>
    </resource-manager>
  </resource-managers>
</jboss>

So now as we know the tags which we can use in an order while migrating from WebLogic to JBoss, it will be an easy task now. 🙂
To know more about these common JBoss specific deployment descriptors please refer to the following link:
http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ENC_Usage_Conventions-EJB_References_with_jboss.xml_and_jboss_web.xml.html
.
.
Thanks 🙂
Middleware Magic Team


JBoss AS7 How can i be always updated !!!

Hi,

JBoss AS7 is adding many many features which were needed by admins and developers always. There are many major changes happening on this product day by day. Many new functionality and many new powers. Much better performances….etc, So the question arises how to get informed with all these changes which are developer and admin friendly and How to stay tuned with this great Application Server.

Here are few very useful links which you might have missed. Following are few very useful links which can be refered any time to get connected with the new technologies and to know what all changes are happening all around you.

1). RedHat you tube Channel:

Which gives you a visual medium to see and feel the technologies which are keep changing all around you day to day.
http://www.youtube.com/user/RedHatVideos

2). JBoss Community:

Most probably worlds most active and powerful community which connects and develops great technologies. If you have any query related to any middleware technologies then following link is your life saver.
http://community.jboss.org/

And If you want to know more about the projects which are keep running in this great community then refer to the following link:
http://www.jboss.org/projects

For Webinars views on various middleware technologies
http://www.jboss.org/webinars

3). Vimeo Videos:

If you want to learn technologies by gong through videos and video tutorials then Vimeo JBoss and redHat sessions will be the best options for you. In the below link there is a search box just type “JBoss” there and then see the magic

http://vimeo.com/25831010

4). Facebook Channel:

.       If you spend most of your time on FaceBook and love the technology at the same time then you can get in touch with this amazing Middleware Application Sever through FaceBook as well. by joining the channel:

http://www.facebook.com/jboss

http://www.facebook.com/redhatsummit

http://www.facebook.com/JBossAPAC

5). Source Codes:

If you are moving to JBoss and if you like coding and peeping inside the java codes or want to see some coded demos then you can get the whole JBoss AS Source code from the following link:

Till JBoss AS 6  http://anonsvn.jboss.org/repos/jbossas/tags/

From JBoss AS 7 Onwards : https://github.com/jbossas/jboss-as If you want to know how to use JBoss AS7 source code from github you can have a look at the following link: http://community.jboss.org/wiki/HackingOnAS7

JBoss Downloads:

How & Why to download JBoss is mentioned in the following link: http://middlewaremagic.com/jboss/?p=9
.
.
.

Which JBoss To Choose?

JBoss AS7 is a Community release and we always recommend you to use the RedHat Supported JBoss Enterprise Application Platform, There are various reasons behind this. Please refer to the Video: http://www.youtube.com/watch?v=iNFV0r9v14g&feature=player_detailpage

.
.
.
Thanks
Middleware Magic Team


Copyright © 2010-2012 Middleware Magic. All rights reserved. |