Bug 206937 - IDE still unable to resolve Spring imports e.g. org.springframework.dao.DataIntegrityViolationException
IDE still unable to resolve Spring imports e.g. org.springframework.dao.DataI...
Status: RESOLVED INCOMPLETE
Product: groovy
Classification: Unclassified
Component: Grails
7.1.1
PC Windows 7
: P3 (vote)
: TBD
Assigned To: Martin Janicek
issues@groovy
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-05 13:38 UTC by rustyx
Modified: 2012-04-10 16:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
netbeans complains on grails import org.springframework.dao.DataIntegrityViolationException (94.08 KB, image/png)
2012-01-05 13:38 UTC, rustyx
Details
grails test project.zip (207.39 KB, application/octet-stream)
2012-01-06 21:04 UTC, rustyx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rustyx 2012-01-05 13:38:12 UTC
Created attachment 114660 [details]
netbeans complains on grails import org.springframework.dao.DataIntegrityViolationException

1. Create a blank Grails 2.0.0 project
2. Create a blank Grails Domain class, say Ttt
3. Run Grails command 'generate-all Ttt'
4. The Grails app works fine, but NetBeans shows an error on this line:
import org.springframework.dao.DataIntegrityViolationException

See attached screenprint.
Comment 1 Martin Janicek 2012-01-05 13:41:53 UTC
This is most probably duplicate of issue 206937. I'll take a look into this later.
Comment 2 Martin Janicek 2012-01-05 13:44:09 UTC
Ops sorry, I meant issue 167284 :]
Comment 3 rustyx 2012-01-05 15:47:31 UTC
Please let me know if the issue is reproducible using the 4 steps above. If not, I'll post more details about my NetBeans config.
Comment 4 Martin Janicek 2012-01-06 19:01:19 UTC
I'm not able to reproduce following the steps you have described. But I'm currently working on a different development branch and it's possible that one of my changes caused that it works for me just fine.

Could you attach the problematic project?
Comment 5 rustyx 2012-01-06 21:04:38 UTC
Created attachment 114690 [details]
grails test project.zip

added test project
Comment 6 Martin Janicek 2012-01-12 14:10:43 UTC
Thanks. I still cannot see any error, which is really weird. I've just tried to create completely new grails project with only one controller in it and even with this trivial setup I can import DataIntegrityViolationException without any trouble. 

Could you please try the same with the latest sources? It is possible that it has been fixed together with issue 206198.
Comment 7 Martin Janicek 2012-01-25 14:08:58 UTC
I'm closing this as WORKSFORME since I can't reproduce the issue. I'm creating projects in the exact way as you described quite often and the problems never occurs. If the problem still remain on your side (even with the latest sources), please provide me some additional information (for example list of plugins in USERHOME/.grails/2.0.0/projects/APPLICATION_NAME/plugins) and reopen the issue.
Thanks in advance
Comment 8 rustyx 2012-01-25 14:18:45 UTC
sorry, I can't debug this issue further, we've since switched over to Spring STS.
thanks for looking anyway.
I will try again after 7.2 is released.
Comment 9 rhv 2012-02-23 19:59:47 UTC
I am seeing a similar issue.  I am following the tutorial at:
https://www.ibm.com/developerworks/java/library/j-grails01158/

Nebeans: NetBeans IDE 7.1 (Build 201112071828)

Java: 1.7.0_03; Java HotSpot(TM) 64-Bit Server VM 22.1-b02

Grails home: C:\bin\grails-2.0.1

When I create a new domain class, the generation fails with this message in the log:
| Loading Grails 2.0.1
| Configuring classpath
| Configuring classpath.
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
| Compiling 2 source files
| Compiling 2 source files.
| Error Compilation error: startup failed:
C:\Users\rogerh\Documents\Projects\TripPlanner\grails-app\controllers\tripplanner\TripController.groovy: 98: unable to resolve class DataIntegrityViolationException 
 @ line 98, column 9.
           catch (DataIntegrityViolationException e) {
           ^

1 error
Comment 10 rhv 2012-02-23 20:49:05 UTC
Comment 9 is incorrect.  The real issue is that this line:

import org.springframework.dao.DataIntegrityViolationException

Shows up with the warning:
"Unable to resolve class org.springframework.dao.DataIntegrityViolationException @line 3, column 1"

This is what my file looks like:
-------------------------------------------------
package tripplanner

import org.springframework.dao.DataIntegrityViolationException

class TripController {

    static allowedMethods = [save: "POST", update: "POST", delete: "POST"]

    def index() {
        redirect(action: "list", params: params)
    }
....
Comment 11 abhayweb 2012-02-29 18:14:09 UTC
Any updates on this Issue? I have the same problem with 7.0.1.
Comment 12 Martin Janicek 2012-03-15 15:55:48 UTC
Not really. I'm still not able to reproduce the original issue following steps described in comment 1. If you still have the same problem, even using the latest development sources (available here: http://bits.netbeans.org/download/trunk/nightly/latest/), please provide some additional information as requested in comment 7.

Until then I can't do much about it :(
Comment 13 getwasim 2012-03-30 19:41:56 UTC
I am using netbeans 7.1.1 and I am also facing the same issue. 

There is surely something wrong which u guys are not able to trace.
Comment 14 qsilver 2012-04-10 16:12:00 UTC
I'm also seeing this issue while following the tutorial located at: http://www.ibm.com/developerworks/java/library/j-grails03118/index.html

NetBeans 7.1.1
Grails 2.0.3
NetBeans "Groovy and Grails" Plugin 1.20.1

The tutorial project still builds and runs correctly even though NetBeans displays the error.  The tutorial has you create a new domain class "Trip", then run generate-all on Trip, then delete all the contents of the TripController and replace with "def scaffold = Trip", then rerun generate-all on Trip.  After the second "generate-all", the error shows up in NetBeans.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo