New com.sun.mirror.* packages - annotation processing

Hello,
i would like to use annotation processing tool (APT), but there is much to learn yet.
So, please help me.
Let�s have an annotation that can be apllied to all code declarations (source code entities).I want to process some *.java files (their proper source code) via APT.From this code i wanna gain (in any way) those declarations (classes, ifaces, methods, constructors, etc.) that are annotated just with the only one annotation that i have.
i was already going through the API, but not well-understood.
As written, i created AnnotationProcessorFactory (just my annotation should be processed by this factory) with an appropriate AnnotationProcessor.
I�ve already done some steps to succeed, but you know, that�s not that i want
Of course, all is performed in build-time, after i call apt command with the option factory with the appropriate factory class
Thank you a lot

Hi,
I am new to this forum and also just started
working on apt can u plz tell me where do i get
com.sun.mirror package and its sub-packages
hanksIf you can use JDK 6, I strongly recommend using the standardized annotation processioning in javac and the packages javax.annotation.processing and javax.lang.model..* instead of apt and its com.sun.mirror.* API. To get started, take a look at
sample/javac/processing/src/CheckNameProcessor.java
under the JDK 6 install directory.
If you just need to compile against the apt API, it is found in the tools.jar file in Sun's JDK; see http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html
You can find a jar file with just the API definition from https://aptmirrorapi.dev.java.net/.

Similar Messages

  • Where to get com/sun/mirror/apt/AnnotationProcessorFactor?

    I am facing a problem with locating com/sun/mirror/apt/AnnotationProcessorFactory while trying to deploy my webservice in Tomcat. Could you please tell in which JAR file can I find this?
    I made an apt build task in this manner. My compile.classpath contains: jaxws-tools.jar.
        <taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
            <classpath refid="compile.classpath"/>
        </taskdef>
        <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
            <classpath refid="jaxws.classpath"/>
        </taskdef>
        <target name="apt">
            <mkdir dir="${build.dir}"/>
            <mkdir dir="${build.dir}/WEB-INF"/>
            <mkdir dir="${build.dir}/WEB-INF/classes"/>
            <mkdir dir="${build.dir}/WEB-INF/lib"/>
            <copy todir="${build.dir}">
                <fileset dir="${web.dir}"/>
            </copy>
            <apt sourcepath="${src.dir}"
                 destdir="${build.dir}/WEB-INF/classes"
                 debug="${compile.debug}"
                 deprecation="${compile.deprecation}">
                <classpath refid="compile.classpath"/>
            </apt>
            <copy todir="${build.dir}/WEB-INF/classes">
                <fileset dir="${src.dir}" excludes="**/*.java"/>
            </copy>
            <copy todir="${build.dir}/WEB-INF/lib">
                <fileset dir="${lib.dir}">
                    <include name="*.jar"/>
                </fileset>
            </copy>
        </target>Then I tried building my project, but I got this error.
    humpty@nifty:~/lab/wsdl/jaxrpc$ ant
    Buildfile: build.xml
    Trying to override old definition of task apt
    apt:
          [apt] An exception has occurred in apt (1.6.0_10). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
          [apt] java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
          [apt]     at java.lang.ClassLoader.defineClass1(Native Method)
          [apt]     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
          [apt]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
          [apt]      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
          [apt]      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
          [apt]      ... 38 more
          [apt] Command invoked: apt -d /home/humpty/lab/wsdl/jaxrpc/build/WEB-INF/classes -sourcepath /home/humpty/lab/wsdl/jaxrpc/src/java -g -classpath /home/humpty/lab/wsdl/jaxrpc/lib/FastInfoset.jar:/home/humpty/lab/wsdl/jaxrpc/lib/activation.jar:/home/humpty/lab/wsdl/jaxrpc/lib/http.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxb-api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxb-impl.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxb-xjc.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxws-api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxws-rt.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jaxws-tools.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jsr173_api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jsr181-api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/jsr250-api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/mimepull.jar:/home/humpty/lab/wsdl/jaxrpc/lib/resolver.jar:/home/humpty/lab/wsdl/jaxrpc/lib/saaj-api.jar:/home/humpty/lab/wsdl/jaxrpc/lib/saaj-impl.jar:/home/humpty/lab/wsdl/jaxrpc/lib/stax-ex.jar:/home/humpty/lab/wsdl/jaxrpc/lib/streambuffer.jar:/home/humpty/lab/wsdl/jaxrpc/lib/woodstox.jar
    BUILD FAILED

    i found it in axis2-1.4-bin\axis2-1.4\lib\jaxb-xjc-2.1.6.jar
    but in different package
    jaxb-xjc-2.1.6.jar\com\sun\xml\xsom\parser
    maybe look for this jar.

  • JFrame Transperency  com.sun.awt package

    Hi,
    In my application i am having the requirement of tranperent window. I searched lot in google and i find transperent JFrame is possible. For making the JFrame transperent the **com.sun.awt** package is needed.
    But this package is unavailable in JDK1.6. I am also using JDK 1.6 version.
    If anyone knows the JDK containning this package. Please let me know that link(JDK containing com.sun.awt package).

    Don�t know if it help, but I found that 'org.apache.batik.svggen.SVGGraphics2D' substitutes 'com.sun.awt.svg.*'
    Also I found some info about com.sun.awt in here:
    http://java.sun.com/products/personaljava/spec-1-1/pJavaSpec.html

  • Cannot find JavaDoc for the com.sun.msv package

    Where can I find the JavaDoc for the com.sun.msv package ?

    What is the msv package? I also (after a quick google search) can't find any mention of this.
    What is the package for?

  • Why can't I import the com.sun.javadoc package?

    I have JDK 1.6 but I don' think it's there...Any idea where I can find the com.sun.javadoc package?

    com.sun.javadoc is not part of the normal JSE API.
    It's part of some packages that come with the JDK that can be used to extend some JDK functionality.
    It's delivered in tools.jar inside your JDKs lib directory.

  • Com.sun.java package

    Hi,
    What is the different between javax.swing and com.sun.java.swing package ? Are they the same ?
    Where can I download com.sun.java.swing package ?
    Regards,
    Lim Boon Sun

    The official Sun statement is that one should only use the classes listed in the APIs, i.e. javax.swing.*. Classes in packages such as com.sun.* contain version dependent implementations and are subject to change without notice. So, if you use them in your programs, it is very likely that your programs will not run under future (and previous) versions of the JRE.
    So, just like the other fellow said, STICK TO THE javax.swing.* packages !

  • "java.lang.NoSuchMethodError: com.sun.tools..apt.Main.process"

    Hi,
    I am a new to Web Services and was following some site for implementing it.
    The link is as below:
    http://www.roseindia.net/webservices/netbeans/Web-Service.shtml
    However while doing the "build and deploy" -- I am getting the following error while doing a ::
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    Warning: MANIFEST.MF modified in the future.
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\META-INF
    Warning: META-INF\context.xml modified in the future.
    Warning: WEB-INF\lib\jaxws-tools-2.1.7.jar modified in the future.
    Warning: WEB-INF\sun-jaxws.xml modified in the future.
    Warning: WEB-INF\web.xml modified in the future.
    Warning: index.jsp modified in the future.
    Warning: modified in the future.
    Warning: META-INF modified in the future.
    Copying 5 files to D:\WebServices-NB-Practice\webservice1\build\web
    library-inclusion-in-archive:
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    library-inclusion-in-manifest:
    Warning: modified in the future.
    wsgen-init-nonJSR109:
    wsgen-MyWebService-nonJSR109:
    *java.lang.NoSuchMethodError: com.sun.tools.apt.Main.process(Lcom/sun/mirror/apt/AnnotationProcessorFactory;[Ljava/lang/String;)I*
    BUILD FAILED (total time: 1 second)
    I am using netbeans version 5.5 for this.
    Although from the initial investigation I understand that this error is related to "jaxws-tools.jar".
    However I could not resolve this error.
    Can Somebody provide me with the steps to resolve this error.
    Regards,
    Avinash

    No, I put the 'main' method just to see if it solved the problem

  • Where to find the doc of package "com.sun.media.util"

    In the jmf.jar,it also has the com.sun.media package,but jmf20.pdf doc not include the comment,how to find the document of package com.sun.meida?

    why nobody answer the easy question for me?

  • Connection timed out: connect at com.sun.mail.imap.IMAPStore.protocolConne

    Hi ,
    Recently, my team need to work with javamail. Here I got a problem: when I run the application in my personal home network , it goes on very well. When I run the program in my company env, it gives error info:
    Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
    at javax.mail.Service.connect(Service.java:313)
    The resource is :
    import java.security.Security;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    *Use Gmail
    public class GmailSender {
    public static void main(String[] args) throws AddressException, MessagingException {
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    // Get a Properties object
    Properties props = System.getProperties();
    //Add proxy for GmailSender
    //especially here, I am not sure whether the proxy really works. In home network, it needn't proxy to run successfully.
    // props.setProperty("proxySet","true");
    // props.setProperty("socksProxyHost","148.87.19.20"); // This IP address is our proxy server address
    // props.setProperty("socksProxyPort","80");
    props.setProperty("mail.smtp.host", "smtp.gmail.com");
    props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.smtp.socketFactory.fallback", "false");
    props.setProperty("mail.smtp.port", "465");
    props.setProperty("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.auth", "true");
    final String username = "XXX";
    final String password = "XXX";
    Session session = Session.getDefaultInstance(props, new Authenticator(){
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(username + "@gmail.com"));
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse("[email protected]",false));
    msg.setSubject("Hello");
    msg.setText("How are you");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent.");
    Will you please help me to review my code and give me some suggestions ?

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

  • Where do i find com.sun.xml

    Hi,
    i need to import com.sun.xml package but i get an error message: The import cannot be resolved. Evidently i miss some API. Where do i find it.
    Thanks in advance.

    Hi,
    i need to import com.sun.xml package but i get an
    error message: The import cannot be resolved.
    Evidently i miss some API. Where do i find it.
    Thanks in advance.It's a good thing you can't find it anyways, because it is not a standard class. Nothing from com.sun.* should be directly used - only java.*, javax.* (and other names that come with the JRE), your own packages, and true 3rd-party packages. com.sun.* doesn't fit any of those categories, they're internal classes (I'm pretty sure anyway).

  • Com.sun.* Not Found only in NetBeans - Javac finds them fine!

    I am not sure what is up with this, but NetBeans will not let me specify anything from the com.* packages. It shows the packages in the auto-type boxes as I type in the name (com.sun.blahblahblah) but highlights the statement with a red underline and states 'Package not found".
    Just to let it be known, I have a look-and-feel demo java file downloaded from the net that compiled perfect and runs as expected, and it makes much use of the com.sun.* packages. And I can run NetBeans with the --laf command line option and it will run using any of the LAF's in the com.* packages itself, but still not see them in the IDE for coding use ><
    Any ideas?
    Thanks in advance.

    I just popped in what you wrote, and another thing just for giggles:
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.crypto.provider.*;and they threw no errors. Why is it that my laf is throwing errors when they are plainly there?
    Example -
           public void actionPerformed(ActionEvent event) {
             try {
               UIManager.setLookAndFeel(getText());
               SwingUtilities.updateComponentTreeUI(
                 ChangingLaF.this);
               // call myFrame.pack()
               // to resize frame for laf
             } catch (IllegalAccessException e) {
               // insert code to handle this exception
             } catch (UnsupportedLookAndFeelException e) {
               // insert code to handle this exception
             } catch (InstantiationException e) {
               // insert code to handle this exception
             } catch (ClassNotFoundException e) {
               // insert code to handle this exception
             }This is the code I got off the net, this + a bit more to the .java file of course, compiles perfect with javac. The programmer used the package path com.sun.blahblah as the radiobutton text, that is what the UIManager.setLookAndFeel(getText()); getText() nonsense is. But other than that I see no reason an erro should be thrown in netbeans over UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel);
    I did try it with quotes though as a previous post recomended and got this message:
    init:
    deps-jar:
    Compiling 1 source file to E:\Java Apps\Calendar\build\classes
    E:\Java Apps\Calendar\src\Main\MainFrame.java:283: unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    1 error
    BUILD FAILED (total time: 0 seconds)
    <

  • Compile Error for Import com.sun.javadoc.*;

    I need to write some simple doclets and found some beginner code on the Sun website. The first line of the sample app is:
    import com.sun.javadoc.*;However, I get a compile error:
    C:\JavaDoc\Doclet\ListClass.java:1: package com.sun.javadoc does not exist
    import com.sun.javadoc.*;I found the com.sun.javadoc package in the tools.jar file in the lib directory of my sdk. So I added the following to my classpath:
    C:\j2sdk1.4.2_08\lib;Then I recompiled but received the same error. What have I done wrong? I'm on Windows XP.
    TIA.

    > C:\j2sdk1.4.2_08\lib;
    C:\j2sdk1.4.2_08\lib\tools.jar;

  • Annotation processing

    Since I have to implement AnnotationProcessor and AnnotationProcessorFactory to use the apt, and those classes are in com.sun.mirror.apt...I suppose the question is, where do I download com.sun.mirror, because my JDK sure didn't come with it....
    Thanks in advance!

    The necessary classes are in tools.jar
    Here's the Start Page and API links:
    http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html

  • Com.sun.media.rtsp.RtspManager and JMF bundle

    Following my first thread,
    I'm looking for any code that uses[b] com.sun.media.rtsp.RtspManager that run sequence like DESCRIBE->SETUP>PLAY>PAUSE.
    Is there a possible link beetwen RtspManager and Player/Processor well documented in JMF ?
    I am looking for com.sun.media package JavaDoc too.
    Thanks
    Arno

    Like I told you in the other thread com.sun packages are not fully supported, technically the could be considered "betas" and are only included to aid developers. Because they are no supported no javadocs exist for them at this time. Like I said you are just going to have downlad the source code and do alot of poking around. From what I can tell, however, the com.sun.media.rtsp package intergrates seemlessly with JMF.

  • Com.sun.messaging.ConnectionFactory to javax.jms.ConnectionFactory

    Here is my scenario:
    ENS - IMQPlugin (Message Queue 3.5)
    Hi, I would like to know how is possible convert this instruction in javax.jms standard and execute it from a simple client (main):
    com.sun.messaging.ConnectionFactory myFactory = new com.sun.messaging.ConnectionFactory();
    myFactory.setProperty(ConnectionConfiguration.imqAddressList,"myIp:myPort");
    myFactory.setProperty(ConnectionConfiguration.imqReconnectEnabled, "true");
    javax.jms.Connection myConnection = myFactory.createConnection("myUser", "myPwd");
    I tried in 1000000 ways, but I can't find any clues...
    Suggestions? Help?
    Thanks in advance

    hanoiroxx wrote:
    Here is my scenario:
    ENS - IMQPlugin (Message Queue 3.5)
    Suggestions? Help?I suggest you ask in the JMQ forum as they have more expertise with JMQ programming:
    http://forum.java.sun.com/forum.jspa?forumID=711
    Regards,
    Shane.

Maybe you are looking for

  • Jabber for windows crashing

    Jabber for windows - crashes on start up CUCM 7.1.3 Windows 7 32 bit Cisco Presence   8.0.2.10000-30 - these are in the application event log Log Name:      Application Source:        MsiInstaller Date:          6/27/2012 10:43:19 PM Event ID:      1

  • Data not matching in RSA3 and PSA.

    Hi, I have loaded data into BW from a Generic datasource and the values in R/3 and BW are not matching. Upon analysis, I found that the values for a characteristic are not matching even in RSA3 and PSA. All the values for other characteristics match

  • 10.8.5 Update - Finder and Lots of apps crash

    Hi All - I've been anxiously awaiting for the screensaver fixes to be resolved that were caused in recent updates, so I installed 10.8.5 which apparently came out today and my 2013 iMac now is constantly telling me that apps are quitting unexpectedly

  • Reg  Table or FM

    Hi  , I am  looking  table  having  Print document no (opbel) and  Anlage ( installation). Thanks, Sonar

  • EMBARRASSINGLY BASIC

    I clicked on something that increased the size of everything on my screen and am unable to figure out how to get the view back to "normal." I know this has to be simple, but I am clueless after going through all sorts of preferences, etc. Please help