This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190092 - Doma annotation library not working well with NetBeans
Summary: Doma annotation library not working well with NetBeans
Status: RESOLVED INCOMPLETE
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 04:37 UTC by Masaki Katakai
Modified: 2010-09-09 02:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (1.67 MB, application/x-compressed)
2010-09-02 04:37 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2010-09-02 04:37:24 UTC
Created attachment 101818 [details]
sample project

Doma (http://doma.seasar.org/) is an annotation library for O/R mapper.
I got the following question from community member in Japan. It's not
working well with NetBeans. Doma project is providing Eclipse plugin but
none for NetBeans and community member is trying NetBeans.

1. Create a Web project
2. Add doma-1.8.0.jar as library

The first is, NetBeans can not find selectById.sql, which should be
located under META-INF in classpath. How to put it in NetBeans?

The second issue is, it looks NetBeans can not find generated source codes
at compilation. 

DomaSample Project:

  META-INF/com/sample/HogeDao/selectById.sql is necessary in classpath.
  How to put it to project?

  So I created sql/ directory under the project and added it for source path and
  class path. Now compilation is passed but editor is showing error.

DomaSample2 project:

  DomaSample/src/java/com/sample/HogeServlet.java is added. I calls

              HogeDao dao = new HogeDaoImpl();

  But it can not be found. The source codes will be generated by annotation library.
Comment 1 David Konecny 2010-09-09 02:50:38 UTC
I wanted to test this but I found documentation and website for doma only in Japanese so I gave up. Could you please attach a project you are testing this on including the doma jar files? Then I will try to run it and get some idea what's wrong.

(In reply to comment #0)
>   META-INF/com/sample/HogeDao/selectById.sql is necessary in classpath.
>   How to put it to project?

I would create META-INF/com/sample/HogeDao/selectById.sql file directly in your Java Sources folder, eg. src/META-INF/com/sample/HogeDao/selectById.sql (You may have to create it in your OS explorer as NetBeans refuse to create packages with hyphen in them.)


>   So I created sql/ directory under the project and added it for source path
> and
>   class path. Now compilation is passed but editor is showing error.

This is go way around it as well.

> 
> DomaSample2 project:
> 
>   DomaSample/src/java/com/sample/HogeServlet.java is added. I calls
> 
>               HogeDao dao = new HogeDaoImpl();
> 
>   But it can not be found. The source codes will be generated by annotation
> library.

If you send us a sample project then we can try to reproduce it and see what's wrong.

Couple of other things to check:
* Source Binary Format of your project should be JDK-6 (or maybe -5) (see project properties - sources)
* doma jars do not seems to define annotation processor so you will have to specify one in project properties in Compiling panel. As I cannot read the documentation I could not check what class is the annotation processor main class.