A problem with annotation @EJB

Hi,
My application uses servlet+JSP+EJB+JBOSS. I want to use a pure java object that is a singleton and within this singleton call an EJB.
I have a servlet that call a singleton:
My servlet
public class FindAdministratorForumServlet extends HttpServlet {
     private static final long serialVersionUID = 1L;
     // ======================================
     // = Entry point method =
     // ======================================
     @Override
     protected void service(final HttpServletRequest request,
               final HttpServletResponse response) throws ServletException,
               IOException {
          final int rows=3;
          int page = Integer.parseInt(request.getParameter("page"));
          List<Topic> discussionList = ListHandlerService.getForumTopics(page); My singleton :
package service;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import javax.ejb.EJB;
import sessionbean.TopicService;
import entitybean.Topic;
public class ListHandlerService {
     private final static int rows=3;
    /** L'instance statique */
    private static ListHandlerService instance;
    /** objet pour la synchronisation.
     * j'ajoute deux "soulignés" (__) au nom de l'attribut car il n'a
     * qu'un intérêt purement technique.
    private static Object objetSynchrone__;
    private static List<Topic> listTopic;
     @EJB
     private static TopicService discussionService;
    /** Récupère l'instance unique de la class Singleton.
    * Remarque : le constructeur est rendu inaccessible
    public static ListHandlerService getInstance() {
        if (null == instance) { // Premier appel
            synchronized(objetSynchrone__) {
                if (null == instance) {
                    instance = new ListHandlerService();
        return instance;
    /** Constructeur redéfini comme étant privé pour interdire
    * son appel et forcer à passer par la méthode
    private ListHandlerService() {
    public static List<Topic> getForumTopics(int page) {
         int i = 0;
          Topic topic;
          LinkedList<Topic> result = new LinkedList<Topic>();
         if (page==1) {
              listTopic = discussionService.getForumTopics();
              ListIterator<Topic> listIterator = listTopic.listIterator();
              while (listIterator.hasNext() && (i< rows)) {
                   topic = listIterator.next();
                   result.add(topic);
                   i++;
         } else {
              ListIterator<Topic> listIterator = listTopic.listIterator();
              while (listIterator.hasNext() && (i< rows*(page-1))) {
                   listIterator.hasNext();
                   i++;
              while (listIterator.hasNext() && (i< rows*page)) {
                   topic = listIterator.next();
                   result.add(topic);
                   i++;
         return result;
    public static int getSize() {
         return listTopic.size();
} In my singleton that is a pure JAVA object, the injection of my EJB with annotation @EJB doesn't seem to work. Indeed when executing, "discussionService" that should be injected and initialized, is null. Isn't it possible to inject an EJB in a pure java object which is a singleton ?
Thank you for your answers.

Is it deployed in the same application?
In they are not in the same application you need to use some other techniques. See the following thread for info:
http://forums.sun.com/thread.jspa?threadID=5332558

Similar Messages

  • Is there a problem with Entity EJBs on 8.1.7?

    Oracle 8.1.7 on Solaris 7:
    Bean Managed persistence:
    TX Attribute - Required:
    UserTransaction bound into JNDI:
    I have tried numerous times and numerous ways to get my Entity beans working. Ejbs that represent tables with 3 columns work fine, but another EJB with 15 columns doesn't - ejbCreate, ejbFindByPrimaryKey work fine, but whenever make some changes and subsequently commit, ejbStore doesn't execute, I even had my client sleep for 15 secs, but still nothing. I know there is a problem with deploying EJBs using JDeveloper 3.2, but I have deployed all these EJBs using deployejb command line tool on the server itself!
    We are right now trying to find out whether Oracle is our right choice for EJBs, any input is highly appreciated.
    Thanks in Advance.
    Ashish.

    Upon further investigation this is what I have found:
    1. Created another EJB for the 15 column table, but this time represented just 3 of its columns - so I have 3 instance variables in the Bean, and a getter/setter method for each except a setter for the primary key.
    2. Undoubtedly it worked fine.
    3. Increased the number of columns to 4 and GUESS WHAT, upon calling setXXX for the newly added setter method and committing, it started failing, the value just wouldn't change in the DB. But when I call all the setXXX methods, it works just fine, I finally narrowed it down to just 1 setXXX method, if I use this method with any other setXXX methods, all the values get updated, otherwise none of them get updated.
    CLEARER PICTURE:
    Supposing I have the following instance variables in the Bean:
    String id;
    String dt;
    String vol;
    String price;
    String beg_day;
    String end_day;
    and the following get/set methods
    String getId()
    String getDt()
    String setDt()
    String getVol()
    String setVol()
    String getPrice()
    String setPrice()
    String getBeg_day()
    String setBeg_day()
    String getEnd_day()
    String setEnd_day()
    Now if I do the following:
    HomeInterface hm = ...JNDI lookup
    UserTransaction ut = ...JNDI lookup
    ut.begin();
    RemoteInterface rm = hm.findByPrimaryKey("1");
    rm.setBeg_day("01-DEC-00");
    ut.commit();
    nothing happens, the date in the underlying table is still the same, BUT.....
    if I do this:
    ut.begin();
    rm = hm.findByPrimaryKey("1");
    rm.setDt("01-DEC-00");
    rm.setBeg_day("01-DEC-00");
    ut.commit();
    IT WORKS..... using setDt() with any other method works for that setXXX method also...
    Anybody experience this at all.....
    Thanks in advance for your help.
    Ashish.
    PS: setDt() is the last method in the stBean.java file with the maximum __method_index, does that make any difference??

  • Problem with Stateful EJB in JBOSS

    Hi,
    J have a problem with invoking stateful EJB methods from my web application deployed in Jboss 4.0.5.GA both. The same EJB with WebLogic functions perfectly, instead with Jboss it often throws the following exception:
    ERROR [org.jboss.ejb.plugins.LogInterceptor]
    EJBException in method: public abstract java.lang.String
    infrastruttura.server.ejb.sessionproxy.SessionProxy.getCodiceGruppo() throws
    java.rmi.RemoteException:
    javax.ejb.EJBException: Application Error: tried to enter Stateful bean with
    different tx context, contextTx: TransactionImpl:XidImpl[FormatId=257,
    GlobalId=pitjb01/305, BranchQual=, localId=305], methodTx:
    TransactionImpl:XidImpl[FormatId=257, GlobalId=pitjb01/306, BranchQual=,
    localId=306]
    at
    org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:283)
    at
    org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at
    org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at
    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at
    org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:954)
    at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at
    org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
    at
    org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:121)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    at $Proxy83.getCodiceGruppo(Unknown Source)
    at org.apache.jsp.jsp.main_jsp._jspService(main_jsp.java:117)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
    at
    org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    2008-02-27 20:19:54,458 ERROR
    [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[PitagoraOlo].[jsp]]
    Servlet.service() for servlet jsp threw exception
    java.rmi.ServerException: EJBException:; nested exception is:
    javax.ejb.EJBException: Application Error: tried to enter Stateful bean with
    different tx context, contextTx: TransactionImpl:XidImpl[FormatId=257,
    GlobalId=pitjb01/305, BranchQual=, localId=305], methodTx:
    TransactionImpl:XidImpl[FormatId=257, GlobalId=pitjb01/306, BranchQual=,
    localId=306]
    at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:365)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)
    at
    org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:954)
    at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at
    org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
    at
    org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:121)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    at $Proxy83.getCodiceGruppo(Unknown Source)
    at org.apache.jsp.jsp.main_jsp._jspService(main_jsp.java:117)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
    at
    org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.ejb.EJBException: Application Error: tried to enter Stateful
    bean with different tx context, contextTx: TransactionImpl:XidImpl[FormatId=257,
    GlobalId=pitjb01/305, BranchQual=, localId=305], methodTx:
    TransactionImpl:XidImpl[FormatId=257, GlobalId=pitjb01/306, BranchQual=,
    localId=306]
    at
    org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:283)
    at
    org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at
    org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at
    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    ... 47 more
    Is there someone can help me?
    thanks forward.

              We got resolved it through bea. This is a know problem of WLS6.1 Sp4. Bea has provided
              us with a patch, after which every thing seems to be working fine.
              Please open a case with bea mentioning the CR092146. You can read the description
              of this CR on internet.
              This will certainly solve your problem.
              Bob Butkus <[email protected]> wrote:
              >We are experiencing the same issue. Did you ever get this resolved?
              

  • Problem with downloading EJBs to JDeveloper

    Hi,
    Upon downloading EJBs to JDeveloper905, I am able to see the bean class, remote and local classes for an entity bean. However, I cannot see the Entity Bean icon (represent the entity) in the respective package in the Model.jpr. Thus, could not access to the EJB Module Editor which previously(before using SCM) can be accessed through the entity bean icon by double clicking it. Is there any other way to access the EJB Module Editor? or it's dependant on the Entity Bean icon? Same problems with the session bean downloaded from SCM.
    Hope to get replies from you guys soon.
    Regards,
    Jo

    @ondrahu
    Sorry for the time you have spent assuming that the problem is at your end by re-installing software; there seems to be no issue accessing via "Update" feature in Ovi Maps application at time of this post.
    As farby points out from past experience it is not uncommon that at times maps server is not available if any maintenance being carried out, so always sensible to try a few hours later before assuming the worst.
    Please let us know if you still have issues in this respect.
    Happy to have helped forum with a Support Ratio = 42.5

  • Problems with annotating in preview

    hi,
    i've had no issues using the annotate function for preview prior to my snow leopard upgrade. the most important function for me was the highlight text function for use in lectures. however, after upgrading, the text i highlight often highlights in "circles" or "ribbon-like shapes" if its a huge chunk of text. i've uploaded some pictures in case you guys don't quite understand what i mean.
    it would be perfect if there's any way i can revert back to the older version of annotating for preview. ):
    this is what it looks like before upgrading:
    this is what it looks like right now:

    So, a week later, and I think I'm narrowing in on the problem. WARNING: long post follows:
    When I bought the new Macbook Pro, I bought an SSD after market to install in the optibay. Once it was installed, I reinstalled Mountain Lion on the SSD and obliterated the original hard drive. I then moved my Home folder from the SSD to the traditional hard drive using instructions found many places on the 'net. (CNET is one source, but there are many others.) Essentially, I created a dummy Admin acount and used it to copy the data from the SSD to the traditional hard drive, then changed the Home folder in System Preferences. Worked like a charm, no errors. Or so I thought.
    I kept the dummy Admin account on the SSD for general troubleshooting, so last night I tried logging in with that account and working in Preview to do what I was trying before... and it worked just fine. Menus popped up super quick, the Export and Save As functions returned the appropriate menus... in short, perfect operation. But this doesn't work properly on my regular user account, whose Home directory was moved.
    I didn't use system links because most articles said this was unnecesary under Lion or Mountain Lion. But it does seem like something is not working correctly, as these menus will not pull up on the account with the moved home folder.
    Any ideas?
    Thanks again!

  • Problem with jikes & EJB

    I've been experiencing a problem using jikes to compile EJBs. Has anyone
    has this type of problem and is there a known fix?
    The beans seem to compile fine, but I get an error when trying to deploy
    them. Here's the error:
    weblogic.ejb.common.DeploymentException: Unexpected I/O exception during
    deployment:
    weblogic.ejb.common.DeploymentException: Problem deploying a bean:
    java.lang.VerifyError: (class:
    com/criatech/contractstation/party/provider/PartyManagerBeanEOImpl_ServiceSt
    ub, method: ensureInitialized signature: ()V) Illegal target of jump or
    branch
    at java.lang.Class.getConstructor0(Native Method)
    at java.lang.Class.getConstructor(Class.java:886)
    Thoughts?
    - Doug

    That seems to be the problem. It only happens on one bean which is a very
    large one. It appears to work ok with the javac 1.3 compiler, but no luck
    with jikes. It's unfortunate, because jikes is SO much faster.
    At least I know someone else is seeing this problem. Thanks for the info.
    - Doug
    "Toby Allsopp" <[email protected]> wrote in message
    news:[email protected]..
    Hi.
    This sounds a bit like a problem we were having when compiling one of the
    generated classes for a bean with a huge number of methods (~400). The
    ensureInitialised method (I think, it might be a different method now -the
    name of the class changes in every WLS version) got so big that some ofthe
    jump instructions needed to become wide jump instructions but both javacand
    jikes got it wrong.
    For us, the workaround was (and still is) to use kjc(http://www.dms.at/kopi/)
    to compile the generated classes.
    This may or may not be your problem, however.
    Toby.
    Doug Cunningham wrote:
    I've been experiencing a problem using jikes to compile EJBs. Has
    anyone
    has this type of problem and is there a known fix?
    The beans seem to compile fine, but I get an error when trying to deploy
    them. Here's the error:
    weblogic.ejb.common.DeploymentException: Unexpected I/O exception during
    deployment:
    weblogic.ejb.common.DeploymentException: Problem deploying a bean:
    java.lang.VerifyError: (class:
    com/criatech/contractstation/party/provider/PartyManagerBeanEOImpl_ServiceSt
    ub, method: ensureInitialized signature: ()V) Illegal target of jump or
    branch
    at java.lang.Class.getConstructor0(Native Method)
    at java.lang.Class.getConstructor(Class.java:886)
    Thoughts?
    - Doug

  • Problem with Annotations

    Live could be so easy... , if Annotations would offer more comfort.
    I have following needs and problems in my application:
    1. transparent Annotations (only with MinMaxRegion possible?)
    2. All Annotations should be moveable and resizeable with the mouse.
    3. There should be access to all Annotations (and their corresponding edit points) even if they are on top of each other.
    4. On MinMaxRegions with only x values (full y range) there are no edit points (small white rectangles to catch them with the mouse)
    5. All lines and edge points of Annotations should be accessable to move and resize the Annotation (like in nearly all drawing programs)
    6. Annotations should be really transparent (although they are colored) that no overlapping Annotation hides other Annotations.
    7. Is there a possibility to get the current marked Annotation (edit points are activated)?
    8. If TrackMode = cwGTrackAllEvents is activated the CWGraph1_AnnotationMouseMove is available but with TrackMode = cwGTrackDragAnnotation not!
       Also the AnnotationMouseDown and AnnotationMouseUp event are then not fired.
    The behaviour can be tested with the attached test program.
    Are there possible workarounds for the listed points?
    Do anybody know, if NI plans an update for the Annotations?
    Helpful suggestions and code snippets would be appreciated.
    Attachments:
    AnnotationTest.zip ‏8 KB

    hello gz-stefan,
    for not implemented features you can submit up a productsuggestion.
    point 1,5 and 6 are currently not implemented. if they get implemented it will be in MStudio for .NET.
    2: The arrow and caption of an annotation is resizable at runtime, but the annotation itself is currently not resizable.
    8: This is expected behavior. You can point to the help for CWGraphTrackModes. Events are automatically handled if you have "DragAnnotation" as the Trackmode. Thus, all of the mouse events will not fire. They are expected to be handled by you if the track mode is "TrackAllEvents"
    can you provide some further information for points 3 and 4?
    regards,
    robert h
    NI germanyMessage Edited by RobertH on 04-27-2006 03:22 AM

  • JDeveloper 2.0 - problem with Deploying EJB

    Hi,
    I have a problem when trying to deply the ACME example EJB's to the Oracle 8i DB. While creating the deployment profile, I've given all the details and even tested the connection with success. When I press finish in the deployment wizard, I get a blank error message-box with just the OK button. Could you help me please.
    Thanks,
    Chandika

    I seem to have sorted this problem. Now I get the following error message when trying to deply to Oracle 8i.
    *** Invoking the Oracle8i deployment utility ***
    java.lang.NullPointerException java.lang.Object java.util.Hashtable.put(java.lang.Object, java.lang.Object)
    void oracle.aurora.server.tools.sess_iiop.WindowsFSContext.<init>(java.util.Hashtable)
    void oracle.aurora.server.tools.sess_iiop.LocalWorkingDirectory.<init>(java.util.Properties)
    void oracle.aurora.server.tools.sess_iiop.ToolImpl.initializeLocal()
    java.lang.String[] oracle.aurora.server.tools.sess_iiop.ToolImpl.parseStdArgs(java.lang.String[])
    void oracle.aurora.server.tools.sess_iiop.ToolImpl.invoke(java.lang.String[], java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
    void oracle.jdeveloper.wizard.deployment.EJBDeployMonitor.run()
    void oracle.jdeveloper.wizard.common.ProgressDialog.run()
    void java.lang.Thread.run()
    null

  • Problems with storing EJB Remote in session and retrieving.

    We store EJB remote object in session and differnt clients retrieve it from session
    before making a business method call. This seems to work in most cases but some
    times it gives the exception attached. This happens only in a clustered environment.
    What has been observed is that if we put the remote object inside a hashtable
    which in-turn is stored in session retrieval from hashtable does not give this
    problem.
    Any suggestion / solution would be greatly appreciated.
    regards,
    Rajesh
    The exception Stack trace is attached
    java.rmi.NoSuchObjectException: Unable to locate EJBHome: 'BalconHome' on server:
    't3://176.19.183.6,176.19.183.15:9616
    at weblogic.ejb20.internal.HomeHandleImpl.getEJBHome(HomeHandleImpl.java:80)
    at weblogic.ejb20.internal.HandleImpl.getEJBObject(HandleImpl.java:184)
    at weblogic.servlet.internal.session.SessionData.getAttribute(SessionData.java:395)
    at com.chase.ccs.util.AccountInfoAccessor.setCurrentAccountAttributeBalcon(AccountInfoAccessor.java:362)
    at com.chase.ccs.util.ModelAccessor.initBlaconOfferModel(ModelAccessor.java:311)
    at com.chase.ccs.balancetransfer.OfferPortlet.service(OfferPortlet.java:88)
    at com.chase.ccs.balancetransfer.OfferView.pageStart(OfferView.java:65)
    at com.chase.ccs.util.ModuleStarter.doAllPageStart(ModuleStarter.java:236)
    at jsp_servlet._templates._template0005._UXaQVaXTUaSYaWaSRZfdXbWSfYXbTRQb.__ccs_mm_tgl_pfp_grid._jspService(__ccs_mm_tgl_pfp_grid.java:316)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:482)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:308)
    at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:116)
    at com.epicentric.servlets.ServletUtils.include(ServletUtils.java:150)
    at com.epicentric.template.Style.execute(Style.java:538)
    at com.epicentric.taglib.html.IncludeGridTag.doStartTag(IncludeGridTag.java:57)
    at jsp_servlet.__index._jspService(__index.java:560)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:242)
    at com.epicentric.servlets.stackable.SiteDispatcherServlet.service(SiteDispatcherServlet.java:195)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    [ejb exception.txt]

    Hello Rajesh,
    Thanks for your sugggestion. Rajesh Karuvat and myself are working on the same
    project.
    I want to know if there is any specific patch for this problem for weblogic 6.1
    sp3.
    The reason we can not just try Weblogic sp4 is that we are using epicentric 4.0
    that is cvertified with weblogic 6.1 sp3 and not sp4.
    I have also opened a case with bea about it. I would reaaly appretiate if you
    can check the detials about it. The case number is 376228.
    Please do revert back.
    Thanks,
    Shilpa
    Rajesh Mirchandani <[email protected]> wrote:
    Try SP4.
    Rajesh Karuvat wrote:
    we are running Weblogic 6.1 SP3
    "Rajesh Karuvat" <[email protected]> wrote:
    We store EJB remote object in session and differnt clients retrieve
    it
    from session
    before making a business method call. This seems to work in mostcases
    but some
    times it gives the exception attached. This happens only in a clustered
    environment.
    What has been observed is that if we put the remote object insidea hashtable
    which in-turn is stored in session retrieval from hashtable does not
    give this
    problem.
    Any suggestion / solution would be greatly appreciated.
    regards,
    Rajesh
    The exception Stack trace is attached
    java.rmi.NoSuchObjectException: Unable to locate EJBHome: 'BalconHome'
    on server:
    't3://176.19.183.6,176.19.183.15:9616
    at weblogic.ejb20.internal.HomeHandleImpl.getEJBHome(HomeHandleImpl.java:80)
    at weblogic.ejb20.internal.HandleImpl.getEJBObject(HandleImpl.java:184)
    at weblogic.servlet.internal.session.SessionData.getAttribute(SessionData.java:395)
    at com.chase.ccs.util.AccountInfoAccessor.setCurrentAccountAttributeBalcon(AccountInfoAccessor.java:362)
    at com.chase.ccs.util.ModelAccessor.initBlaconOfferModel(ModelAccessor.java:311)
    at com.chase.ccs.balancetransfer.OfferPortlet.service(OfferPortlet.java:88)
    at com.chase.ccs.balancetransfer.OfferView.pageStart(OfferView.java:65)
    at com.chase.ccs.util.ModuleStarter.doAllPageStart(ModuleStarter.java:236)
    at jsp_servlet._templates._template0005._UXaQVaXTUaSYaWaSRZfdXbWSfYXbTRQb.__ccs_mm_tgl_pfp_grid._jspService(__ccs_mm_tgl_pfp_grid.java:316)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:482)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:308)
    at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:116)
    at com.epicentric.servlets.ServletUtils.include(ServletUtils.java:150)
    at com.epicentric.template.Style.execute(Style.java:538)
    at com.epicentric.taglib.html.IncludeGridTag.doStartTag(IncludeGridTag.java:57)
    at jsp_servlet.__index._jspService(__index.java:560)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:242)
    at com.epicentric.servlets.stackable.SiteDispatcherServlet.service(SiteDispatcherServlet.java:195)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Transaction problem with stateless EJB and DAO

    Hi,
    I'm using a stateless session bean with container managed transaction and I have a method, which updates a row via CMP entity bean and then calls stored procedure, using a DAO object, which has to use the updated data. Both calls must be done in one transaction. The problem is that the stored procedure doesn't see the changes made from the update via CMP EJB, but after the method exits the changes are in the database. I'm using WebSphere 4.0.3 and DB2 7.2. Method code example in the stateless bean:
    public doIt(ValueObject vo) throws ... {
    OrderPosRemote opr = getOrderPosRemote();
    opr.update(vo);
    getDAO().recalc(vo);
    } catch (DAOException daoex) {
    getSessionContext().setRollbackOnly();
    And in the DAO:
    public boolean recalc(...) throws DAOException {
    Connection conn = getConnFromDataSource();
    CallableStatement cstmt = conn.prepareCall("call ...(?,?)");
    cstmt.execute();
    ... // close cstmt and release connection to the pool
    Any help will be highly appreciated !

    Hi meadandale,
    this was my first guess too and I set this attribute in the session bean method, then into the update method of the CMP bean and "manually" to the connection object in the DAO like this:
    conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    The isolation level is set correctly (IMHO), because when I comment the line above in the DAO, an exception is thrown stating that the isolation level can't be changed within a transaction.
    Unfortenully this didn't help too. Should I set some special attribute to the database or connection pool additionally ?
    I don't understand what is the problem actually - it is definitely one transaction and why this doesn't work is not very clear to me ...

  • Problems with an EJB refering a class in a Resource Adapter in 8.1 to 9.2 M

    Hello,
    I have the following problem: I got an EAR let's say application.ear, the ear has a Resource Adapter inside, adapter.rar, the adapter has some jar files inside which are used by an EJB that is deployed on the same server, but the EJB is not able to find the required JAR files, I'm getting NoClassDefFoundError. Is that a configuration issue? It was working fine on Bea 8.1. I noticed that in the resource adapter's configuration "Global Access To Classes Enabled" is set to false, could that be the problem? If so, where can I set it to true?
    Greetings
    Dennis

    weblogic-ra.xml
    <enable-global-access-to-classes>true</enable-global-access-to-classes>
    Thanks
    Vishnu

  • Problems with OC4J EJB deployment and the data-sources.xml file

    I am running 2 Windows 2000 Machines one with the 8.1.7 database another with iAS 1.0.2.2.1 and OC4J.
    I am trying to deploy a 3rd party EJB-based application whic seems to have deployed successfully except when I try to test the EJB deployment via a jsp it can't connect to the database, giving the error:
    1/16/02 4:52 PM VerySimple: Servlet error
    java.lang.NoClassDefFoundError: com.netexp.user.UserManagerHome
    at com.netexp.beans.BeanHelper.class$(Unknown Source)
    at com.netexp.beans.BeanHelper.getUserManagerBean(Unknown Source)
    at /very_simple.jsp._jspService(/very_simple.jsp.java:48) (JSP page line 27)
    at com.orionserver[Oracle9iAS (1.0.2.2.1) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5459)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:508)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:177)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:576)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62)
    I try to update the file using the installdatasource switch thus:
    C:\Oracle\iSuites\j2ee\home>java -jar admin.jar ormi://localhost admin adm_pwd -application apptricityII -installDataSource -jar %ORACLE_HOME%\jdbc\lib\classes12.zip -url jdbc:oracle:thin:@db_host.unitas.com:1521:db_name -connectionDriver oracle.jdbc.driver.OracleDriver -location jdbc/pool/OracleDataSource -username scott -password tiger
    And get the following error:
    Exception passing by from remote server: java.lang.InstantiationException: No class specified for jdbc/pool/OracleDataSource
    java.lang.InstantiationException: No class specified for jdbc/pool/OracleDataSource
    <<no stack trace available>>
    Error adding source: No class specified for jdbc/pool/OracleDataSource
    Please advise.
    I have followed the instructions in 'EJB Primer' and 'Using Oracle9iAS Containers for J2EE' to no avail. And I can't find any meaningfull data-sources.xml samples. I have been struggling with this for some time.
    Is there any other file, do I need to bind anything?
    I'd appreciate your assistance.
    Thank you
    Louiza

    Hi Louiza,
    Show us your web.xml and ejb-jar.xml files as well as your
    data-source.xml file.
    Thanks,
    Avi.

  • Problem with building EJB with inheritance

    I've created a EJB project in my workshop 8.1.4 application.
    Since all my tables contains a common subset of columns, I'd like to create a superclass for all CMP entity beans which contains the handful of CMP fields and business methods pertaining to them.
    I tried to do it in Workshop by creating a new superclass (BaseEB.java) which extends GenericEntityBean class.
    When building, the script tries to run ejbgen on BaseEB.java, which obviously fails because BaseEB does not contain all the required @ejbgen tags, as it is not meant to be used by itself.
    I think the solution is a matter of making the build script bypass BaseEB.java, but how can that be done?.

    This is my base EJB. There are some @ejbgen tags defined, but it does not have all required ejbgen tags, especially in the class javadoc. The classes that extends from this are expected to define them.
    package occ;
    import java.util.*;
    import weblogic.ejb.GenericEntityBean;
    public abstract class BaseEB extends GenericEntityBean
          * @ejbgen:local-method
         public void touch(String username){
              java.util.Date currDate = new Date();
              setUpdateDateTime(currDate);
              setUpdateUsername(username);
              setUpdateTimeID(new Long(getUpdateTimeID().longValue() + 1));
          * @ejbgen:local-method
         public void setCreateBy(String username){
              java.util.Date curr = new Date();
              setCreateUsername(username);
              setCreateDateTime(curr);
              setUpdateUsername(username);
              setUpdateDateTime(curr);
              setUpdateTimeID(new Long(1));
          * @ejbgen:cmp-field column = "UPDATEDATETIME"
          * @ejbgen:local-method
         public abstract void setUpdateDateTime(Date val);
          * @ejbgen:local-method
         public abstract Date getUpdateDateTime();
          * @ejbgen:cmp-field column = "UPDATEUSERNAME"
          * @ejbgen:local-method
         public abstract void setUpdateUsername(String val);
          * @ejbgen:local-method
         public abstract String getUpdateUsername();
          * @ejbgen:cmp-field column = "CREATEDATETIME"
          * @ejbgen:local-method
         public abstract void setCreateDateTime(Date val);
          * @ejbgen:local-method
         public abstract Date getCreateDateTime();
          * @ejbgen:cmp-field column = "CREATEUSERNAME"
          * @ejbgen:local-method
         public abstract void setCreateUsername(String val);
          * @ejbgen:local-method
         public abstract String getCreateUsername();
          * @ejbgen:cmp-field column = "UPDATETIMEID"
          * @ejbgen:local-method
         public abstract void setUpdateTimeID(Long val);
          * @ejbgen:local-method
         public abstract Long getUpdateTimeID();
    }Errors while building in workshop.
    EJBGen 2.16
    Error: Couldn't determine the type of the EJB 'occ.BaseEB'.  Please make sure that:
      - It is an Enterprise Java Bean
      - Its superclass is in your classpath or that its type is specified
        with an @ejbgen:entity|session|message-driven attribute.
    1 error.
    ERROR: Java returned: 1
    BUILD FAILED
    ERROR: Java returned: 1

  • MINOR CODE PROBLEM WITH AXIS,EJB,WSAD,WEBSPHERE

    Hi All,
    I am using below environment
    client side
    ANT + Sun 1.4.2 JRE
    JIBX (DE)SERIALIZERS, JIBX BINDING
    AXIS 1.2 RC2 STUBS
    server side
    JIBX (DE)SERIALIZERS, JIBX BINDING
    AXIS 1.2 RC2
    JIBX BETA 3D
    WSAD 5.1.2
    WEBSPHERE 5.0 Test Environment
    Basically I used WSAD 5.1.2 to code my EJB's. When I run my web service java client program to access a ejb web service exposed using AXIS,JIBX (DE)SERIALIZERS, WEBSPHERE 5.0 I am getting below exception on client side and no exception atleast in my server console. I guess the cause of this error is I used Sun 1.4.2 JRE on the client side to construct custom types and
    passed them to server which uses IBM JRE 1.3.1 inside WebSphere 5.0 Test Environment. I am not sure may be it is a guess. If so how to ask ANT on take IBM JRE 1.3.1 with <javac> task. Please suggest ... ?
    [java] - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    [java] Connecting to service at http://localhost:9999/Axis12Rc2IrscWeb/services/DCPlanListWS
    [java] Sending first request...
    [java] AxisFault
    [java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    [java] faultSubcode:
    [java] faultString: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    [java] java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:
    [java] org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (Rep. IDRMI:com.americanexpress.bluestar.beans.requestbeans.DCPlanListRequestBean:74291B603AE70D98:BE5D2E53ED0132D4) = BE5D2E53ED0132D4 whereas Target (Rep. ID RMI:com.americanexpress.bluestar.beans.requestbeans.DCPlanListRequestBean:74291B603AE70D98:C8417C221AEF1714) = C8417C221AEF1714 minor code: 4942F89A completed: No
    [java] faultActor:
    [java] faultNode:
    [java] faultDetail:
    [java] {http://xml.apache.org/axis/}hostname:hyddl0337
    [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    [java] java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:
    [java] org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (Rep. IDRMI:com.americanexpress.bluestar.beans.requestbeans.DCPlanListRequestBean:74291B603AE70D98:BE5D2E53ED0132D4) = BE5D2E53ED0132D4 whereas Target (Rep. ID RMI:com.americanexpress.bluestar.beans.requestbeans.DCPlanListRequestBean:74291B603AE70D98:C8417C221AEF1714) = C8417C221AEF1714 minor code: 4942F89A completed: No
    [java] at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
    [java] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
    [java] at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083)
    [java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
    [java] at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    [java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    [java] at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    [java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    [java] at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
    [java] at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
    [java] at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    [java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    [java] at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:226)
    [java] at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
    [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
    [java] at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
    [java] at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
    [java] at org.apache.axis.client.Call.invoke(Call.java:2702)
    [java] at org.apache.axis.client.Call.invoke(Call.java:2378)
    [java] at org.apache.axis.client.Call.invoke(Call.java:2301)
    [java] at org.apache.axis.client.Call.invoke(Call.java:1758)
    [java] at irsc.bluestar.DCPlanListWSBindingStub.getDCPlanList(DCPlanListWSBindingStub.java:180)
    [java] at irsc.bluestar.IrscDcPlanListWsClient.query(IrscDcPlanListWsClient.java:43)
    [java] at irsc.bluestar.IrscDcPlanListWsClient.main(IrscDcPlanListWsClient.java:67)
    [java] Exception in thread "main"
    [java] Java Result: 1
    Thanks & Regards,
    Kumar.

    I remember seeing that post sometime ago. And yes, your guess is quite good. WAS 5.1 uses jdk 1.3.1
    As for Ant, if you want to use a different version class, I think you need to set "build.compiler" property. Of course, a look into Ant docs would be more helpful.
    Cheers!
    ***Annie***

  • Problem with annotation

    I have a plugin (developed in C++) to add stamps in a pdf. This plugin is based on the Stamper sample included in Acrobat 8 SDK. The plugin works well when adding stamps on a pdf page that is not rotated, but when the page is rotated the stamp rotates as well.
    I don't want the stamp to rotate with the page, so I tried to set the annotation flag to 'No rotate' as follows:     PDAnnotSetFlags(annot,pdAnnotNoRotate);
    but it doesn't work.
    Does anyone have an idea about how to solve this?.
    Thanks in advance,

    I know how to get the page's rotation (pdPage = AVPageViewGetPage(pageView);
    pdRotate = PDPageGetRotate(pdPage)
    but I don't know how to rotate the stamp. Could you tell me how to do it?
    This is part of my code.
    Thanks,
    if  
    ((rect->top == rect->bottom) || (rect->right == rect->left)){
    rect->top +=75;
    rect->right += 250;
    pdPage = AVPageViewGetPage(pageView);
    AVDoc avDoc = AVPageViewGetAVDoc(pageView);
    AVPageViewDeviceRectToPage ( pageView, rect, &pdLocation);
    // Add the new annotation to the page.
    annot = PDPageAddNewAnnot(pdPage, -1, Stamper_K, &pdLocation);
    cAnnotObj = PDAnnotGetCosObj(annot);
    cdoc = PDDocGetCosDoc(PDPageGetDoc(pdPage));
    // See PDF Specification for more information on the Flags key.--06/10/2010
    cIntObj = CosNewInteger (cdoc, false, 4L);
    CosDictPutKeyString(cAnnotObj, Flags_KStr, cIntObj);
    cAPDictObj = CosNewDict(cdoc, 
    false, 1L);cNullObj = CosNewNull();
    // Read in the stream for the appearance key.
    memset(&buf, 0, 
    sizeof(buf));
    strcat(buf, "q 1 w 0.12 0.29 0.49 RG 0.8 0.85 0.95 rg 1 3 98 94 re B Q BT /STAMPR 22 Tf 15 60 TD 40 Tz (QUALIFICATION)Tj /STAMPR2 22 Tf 20 -40 TD 30 Tz (Year 11)Tj ET");
    s = (ASUns32)strlen(buf);
    stm = ASMemStmRdOpen(buf, s);
    attributesDict = CosNewDict(cdoc, 
    false, 5);LengthEntry = CosNewInteger(cdoc, 
    false, s);CosDictPutKeyString(attributesDict, Length_KStr, LengthEntry);
    cStmObj = CosNewStream(cdoc, 
    true, stm, 0, true, attributesDict, cNullObj, s);cStmDictObj = CosStreamDict(cStmObj);
    CosDictPutKeyString(cStmDictObj, 
    "Type", CosNewNameFromString(cdoc, false, "XObject"));CosDictPutKeyString(cStmDictObj, 
    "Subtype", CosNewNameFromString(cdoc, false, "Form"));CosDictPutKeyString(cStmDictObj, 
    "FormType", CosNewInteger(cdoc, false, 1L));cBBoxObj = CosNewArray(cdoc, 
    false, 4L);CosArrayInsert(cBBoxObj, 0L, CosNewInteger(cdoc, 
    false, 0L));CosArrayInsert(cBBoxObj, 1L, CosNewInteger(cdoc, 
    false, 0L));CosArrayInsert(cBBoxObj, 2L, CosNewInteger(cdoc, 
    false, 100L));CosArrayInsert(cBBoxObj, 3L, CosNewInteger(cdoc, 
    false, 100L));CosDictPutKeyString(cStmDictObj, 
    "BBox", cBBoxObj);
    // Create Resource dictionary for XObject.
    cResObj = CosNewDict(cdoc, 
    false, 5L);  
    // Add Font resource to Resources dictionary.
    fontResObj = CosNewDict(cdoc, true, 2L);fontResObj2 = CosNewDict(cdoc, 
    true, 5L);fontResObj3 = CosNewDict(cdoc, 
    true, 5L);cObj = CosNewNameFromString(cdoc, 
    false, "Font");CosDictPutKeyString(fontResObj2, 
    "Type", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "Type1");CosDictPutKeyString(fontResObj2, 
    "Subtype", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "STAMPR");CosDictPutKeyString(fontResObj2, 
    "Name", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "Arial,Bold");CosDictPutKeyString(fontResObj2, 
    "BaseFont", cObj);CosDictPutKeyString(fontResObj, 
    "STAMPR", fontResObj2);cObj = CosNewNameFromString(cdoc, 
    false, "Font");CosDictPutKeyString(fontResObj3, 
    "Type", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "Type1");CosDictPutKeyString(fontResObj3, 
    "Subtype", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "STAMPR2");CosDictPutKeyString(fontResObj3, 
    "Name", cObj);cObj = CosNewNameFromString(cdoc, 
    false, "Arial,BoldItalic");CosDictPutKeyString(fontResObj3, 
    "BaseFont", cObj);CosDictPutKeyString(fontResObj, 
    "STAMPR2", fontResObj3);CosDictPutKeyString(cResObj, 
    "Font", fontResObj);  
    //-----------KAS 28062010--------------
    // Set up ProcSet Resources.
    cProcSetObj = CosNewArray(cdoc, 
    false, 2L);CosArrayPut(cProcSetObj, 0L, CosNewNameFromString(cdoc, 
    false, "PDF"));CosArrayPut(cProcSetObj, 1L, CosNewNameFromString(cdoc, 
    false, "Text"));CosDictPutKeyString(cResObj, 
    "ProcSet", cProcSetObj);  
    // Put Resources dictionary in XObject's stream dictionary.
    CosDictPutKeyString(cStmDictObj, 
    "Resources", cResObj);  
    // Set the stream object (now a Forms XObject) as the normal (N) key
    // and add to the appearance (AP) key.
    CosDictPut(cAPDictObj, FaceNormal_K, cStmObj);
    CosDictPutKeyString(cAnnotObj, Appearance_KStr, cAPDictObj);

Maybe you are looking for