Upgrading Annotations

This release incorporates support for the standard for Java annotations released with Java 5; that standard is defined in JSR 175. This topic describes how version 8.1 annotations are treated during upgrade to version 10.x. An obvious change is the difference in syntax between the two versions; version 8.1 annotations were embedded in a Javadoc-style comment, for example. When you use upgrade tools to upgrade a version 8.1 application, the tools upgrade all of the annotations that have counterparts in version 10.x. Upgrade tools generally leave the old-style annotations, which are ignored by the version 10.x runtime.

Note: For general information about Java 5 annotations, see the Annotations topic at the Sun web site.

For a more complete list of changes affecting applications upgraded from version 8.1, see Changes During Upgrade from WebLogic Workshop 8.1 to Version 10.x.

Relationship Between Version 8.1 and Version 10.x Annotations

To take advantage of the Java 5 annotations feature, version 10.x of Workshop uses migrated versions of the annotations that version 8.1 supported. So, for example, the version 8.1 @common:operation annotation is replaced in version 10.x with the @WebMethod annotation to signify that a method should be used as a web service operation.

For the most part, version 8.1 annotations have counterparts in version 10.x. However, there are a few exceptions. It's also worth noting that most of the migrated annotations are now part of the Apache Beehive project.

Note: Upgrade tools will upgrade all annotations for which there is a version 10.x counterpart.

Version 8.1 Annotation Version 10.x Annotation Containing Component Type
common:context weblogic.jws.Context Web service
common:context org.apache.beehive.controls.api.context.Context Control
common:control org.apache.beehive.controls.api.bean.Control Multiple
common:define No version 10.x counterpart.  
common:message-buffer weblogic.jws.MessageBuffer Web service
common:message-buffer com.bea.control.annotations.MessageBuffer. Must be used in the control interface; no longer supported on the control implementation. Control
common:operation javax.jws.WebMethod Web service
common:operation No version 10.x counterpart Control
common:schema No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported.  
common:security com.bea.control.annotations.Security Control
common:security (callback-roles-allowed attribute) weblogic.jws.security.CallbackRolesAllowed Web service
common:security (run-as attribute) weblogic.jws.security.RunAs Web service
common:security (roles-referenced attribute) weblogic.jws.security.RolesReferenced Web service
common:target-namespace targetNamespace attribute in javax.jws.WebService annotation. Web service
common:xmlns No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Web service
editor-info:code-gen No version 10.x counterpart. Custom control source
editor-info:link No version 10.x counterpart. See Keeping Files in Sync in the Absence of IDE Support for a suggested workaround. Web service
ejbgen:automatic-key-generation weblogic.ejbgen.AutomaticKeyGeneration EJBs
ejbgen:cmp-field weblogic.ejbgen.CmpField EJBs
ejbgen:cmr-field weblogic.ejbgen.CmrField EJBs
ejbgen:compatibility weblogic.ejbgen.Compatibility EJBs
ejbgen:create-default-dbms-tables weblogic.ejbgen.CreateDefaultDbmsTables EJBs
ejbgen:ejb-client-jar weblogic.ejbgen.EjbClientJar EJBs
ejbgen:ejb-interface weblogic.ejbgen.EjbInterface EJBs
ejbgen:ejb-local-ref weblogic.ejbgen.EjbLocalRef EJBs
ejbgen:ejb-ref weblogic.ejbgen.EjbRef EJBs
ejbgen:entity-cache-ref weblogic.ejbgen.EntityCacheRef EJBs
ejbgen:entity weblogic.ejbgen.Entity EJBs
ejbgen:env-entry weblogic.ejbgen.EnvEntry EJBs
ejbgen:file-generation weblogic.ejbgen.FileGeneration EJBs
ejbgen:finder weblogic.ejbgen.Finder EJBs
ejbgen:foreign-jms-provider weblogic.ejbgen.ForeignJmsProvider EJBs
ejbgen:jar-settings weblogic.ejbgen.JarSettings EJBs
ejbgen:jndi-name weblogic.ejbgen.JndiName EJBs
ejbgen:local-home-method weblogic.ejbgen.LocalHomeMethod EJBs
ejbgen:local-method weblogic.ejbgen.LocalMethod EJBs
ejbgen:message-driven weblogic.ejbgen.MessageDriven EJBs
ejbgen:method-isolation-level-pattern weblogic.ejbgen.MethodIsolationLevelPattern EJBs
ejbgen:method-permission-pattern weblogic.ejbgen.MethodPermissionPattern EJBs
ejbgen:relation weblogic.ejbgen.Relation EJBs
ejbgen:relationship-caching-element weblogic.ejbgen.RelationshipCachingElement EJBs
ejbgen:remote-home-method weblogic.ejbgen.RemoteHomeMethod EJBs
ejbgen:remote-method weblogic.ejbgen.RemoteMethod EJBs
ejbgen:resource-env-ref weblogic.ejbgen.ResourceEnvRef EJBs
ejbgen:resource-ref weblogic.ejbgen.ResourceRef EJBs
ejbgen:role-mapping weblogic.ejbgen.RoleMapping EJBs
ejbgen:security-role-ref weblogic.ejbgen.SecurityRoleRef EJBs
ejbgen:select weblogic.ejbgen.Select EJBs
ejbgen:session weblogic.ejbgen.Session EJBs
ejbgen:value-object weblogic.ejbgen.ValueObject EJBs
jc:connection com.bea.control.JdbcControl.ConnectionDataSource Database control
jc:conversation com.bea.control.ServiceControl.Conversation Service control and others.
jc:ejb org.apache.beehive.controls.system.ejb.EJBControl.EJBHome EJB control
jc:handler com.bea.control.ServiceControl.Handler Service control
jc:jms org.apache.beehive.controls.system.jms.JMSControl.Destination JMS control
jc:jms-headers org.apache.beehive.controls.system.jms.JMSControl.HeaderType, org.apache.beehive.controls.system.jms.JMSControl.Priority, org.apache.beehive.controls.system.jms.JMSControl.Expiration, org.apache.beehive.controls.system.jms.JMSControl.Type JMS control
jc:jms-property org.apache.beehive.controls.system.jms.JMSControl.PropertyValue JMS control
jc:location com.bea.control.ServiceControl.Location Service control
jc:log No version 10.x counterpart. The current implementation of the Database control does not currently support logging. Database control
jc:parameter-xml No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Service control
jc:protocol com.bea.control.ServiceControl.SOAPBinding and com.bea.control.ServiceControl.JmsSoapProtocol. Service control
jc:reliable No version 10.x counterpart. Service control
jc:return-xml No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Service control
jc:selector No version 10.x counterpart. The JMS control in version 10.x does not support receiving messages. Service Broker control
jc:sql com.bea.control.JdbcControl.SQL Database control
jc:timer com.bea.control.TimerControl.TimerSettings Timer control
jc:ws-security-callback No version 10.x counterpart. This was used to support WS-Security in web services. Upgraded code should use the Web Services Policy Framework (WS-Policy) instead. Service control
jc:ws-security-service No version 10.x counterpart. This was used to support WS-Security in web services. Upgraded code should use the Web Services Policy Framework (WS-Policy) instead. Service control
jcs:control-tags No version 10.x counterpart. Custom control source
jcs:ide No version 10.x counterpart. Custom control source
jcs:jc-jar No version 10.x counterpart. Custom control source
jcs:suppress-common-tags No version 10.x counterpart. Custom control source
jws:context weblogic.jws.Context Web service
jws:control org.apache.beehive.controls.api.bean.Control Web service
jws:conversation weblogic.jws.Conversation Web service
jws:conversation-lifetime weblogic.jws.Conversational Web service
jws:define No version 10.x counterpart. Web service
jws:handler javax.jws.HandlerChain (for files) and javax.jws.soap.SOAPMessageHandlers (for individual classes) Web service
jws:location com.bea.control.ServiceControl.Location Web service
jws:message-buffer weblogic.jws.MessageBuffer Web service
jws:operation javax.jws.WebMethod Web service
jws:parameter-xml No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Web service
jws:protocol javax.jws.soap.SOAPBinding Web service
jws:reliable Use WS-Policy files and the weblogic.jws.Policies annotation. Web service
jws:return-xml No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Web service
jws:schema No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Web service
jws:target-namespace targetNamespace attribute in javax.jws.WebService annotation. Web service
jws:wsdl wsdlLocation attribute in javax.jws.WebService annotation. Web service
jws:ws-security-callback No version 10.x counterpart. This was used to support WS-Security in web services. Upgraded code should use the Web Services Policy Framework (WS-Policy) instead. Web service
jws:ws-security-service Use the weblogic.jws.Policy and weblogic.jws.Policies annotations. Web service
jws:xmlns No version 10.x counterpart. This was used in conjunction with XQuery maps, which are no longer supported. Web service
jpf:controller org.apache.beehive.netui.pageflow.annotations.Jpf.Controller

Page flow

jpf:action org.apache.beehive.netui.pageflow.annotations.Jpf.Action Page flow
jpf:forward org.apache.beehive.netui.pageflow.annotations.Jpf.Forward Page flow
jpf:catch org.apache.beehive.netui.pageflow.annotations.Jpf.Catch Page flow
jpf:validation-error-forward org.apache.beehive.netui.pageflow.annotations.Jpf.Forward Page flow
jpf:exception-handler org.apache.beehive.netui.pageflow.annotations.Jpf.ExceptionHandler Page flow
jpf:message-resources org.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle Page flow

Resolving Ambiguity Related to Annotation Types

Unlike version 8.1, in version 10.x annotations are Java types that must either be imported or fully-qualified in code. Because code using these types is being added to your code in order to upgrade from annotations in your version 8.1 code, there can sometimes be ambiguity when the added annotations have the same names as types your code may already have been using.

For example, imagine that your version 8.1 session bean happens to use the JMS Session interface and imports javax.jms.*. Your upgraded session bean will be marked with the @Session annotation (weblogic.ejbgen.Session). Your imports will include javax.jms.* and weblogic.ejbgen.Session, but the compiler doesn't know which is intended with a simple @Session annotation.

In general, be aware that compilation errors in your upgraded code may simply be due to this ambiguity. The remedy for this issue is to fully qualify annotation type names where they're used.

Related Topics

Changes During Upgrade from WebLogic Workshop 8.1 to Version 10.x


Still need help? Post a question on the Workshop newsgroup.