feather812002 / grails-dynamic-domain-class-plugin Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/grails-dynamic-domain-class-plugin
Automatically exported from code.google.com/p/grails-dynamic-domain-class-plugin
What steps will reproduce the problem?
1. grails install-plugin dynamic-domain-class
2. grails install-ddc-demo
3. grails run-app
4. in browser when I try to create new domain by pressing the button "Create
domain class(es)" errors thrown:
"...Caused by NullPointerException: null
->> 122 | enhanceDomainClass in DynamicDomainService.groovy"
I'm using plugin version 0.3 con grails 2.0.4 in Windows 7.
I think that problem is in the version of grails that is 2.0.4.
Thanks.
Original issue reported on code.google.com by [email protected]
on 6 Jul 2012 at 8:18
What steps will reproduce the problem?
1. (optional; you can use an existing project) Create a new Grails app and add
a single domain with a single field. Generate all other relevant codes (e.g.
controller & views).
2. Install the plugin and the demo.
3. On your other controllers outside of the plugin, place any new code... say,
a simple "println" statement on any action.
4. Save the controller.
What is the expected output? What do you see instead?
Expected: If you change your controller codes and save, the changes should
reflect immediately without restarting the application.
However, I was able to repeat this problem with a new project... Once the
plugin gets installed, no matter how small the change to an action's/function's
code (like a println), the app has to be restarted for the changes to take
effect.
What version of the product are you using? On what operating system?
Grails: 1.3.7
STS: 2.7.2
OS: Win7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 6 Oct 2011 at 9:02
What steps will reproduce the problem?
1. Install dynamic-domain-class plugin in a newly created project.
2. Install multi-tenant-core plugin.
3. Try loading a class dynamically.
What is the expected output? What do you see instead?
It should load the class but gives error.
What version of the product are you using? On what operating system?
Grails-1.3.7, multi-tenant-core-1.0.3, dynamic-domain-class-0.2.1, O.S-Windows-7
Please provide any additional information below.
Below is the piece of code where exception occurs. It's in
dynamicDomainService->updateSessionFactory(ctx) method.
['entityPersisters', 'collectionPersisters', 'identifierGenerators',
'namedQueries', 'namedSqlQueries', 'sqlResultSetMappings', 'imports',
'collectionRolesByEntityParticipant', 'classMetadata',
'collectionMetadata'].each { fieldName ->
def field = ReflectionUtils.findField(ctx.sessionFactory.getClass(), fieldName)
field.accessible = true
field.set ctx.sessionFactory, new HashMap(field.get(newSessionFactory))
}
I also have found a solution and had to change the code. But, please make it
dynamic so that in newer version it doesn't come up. Below is the resolved code:
['entityPersisters', 'collectionPersisters', 'identifierGenerators',
'namedQueries', 'namedSqlQueries', 'sqlResultSetMappings', 'imports',
'collectionRolesByEntityParticipant', 'classMetadata',
'collectionMetadata'].each { fieldName ->
def field = ReflectionUtils.findField(ctx.sessionFactory.wrapped.getClass(), fieldName)
field.accessible = true
field.set ctx.sessionFactory.wrapped, new HashMap(field.get(newSessionFactory))
}
Original issue reported on code.google.com by [email protected]
on 6 May 2012 at 4:10
The plugin was generated with 1.3.5 so that's what is specified in the minimum
required Grails version, but I'm sure it'll work in any version of 1.3 and most
likely also in any version of 1.2
Original issue reported on code.google.com by [email protected]
on 20 Nov 2010 at 2:26
What steps will reproduce the problem?
1. Run demo.gsp
2. Add a belongsTo association to the Book class (e.g. static belongsTo =
[author: Author])
3. Generate the dynamic classes
What is the expected output? What do you see instead?
Expected: Classes would be generated
Actual: An error similar to this is displayed:
Apparent variable 'Author' was found in a static scope but doesn't refer to a
local variable, static field or class. Possible causes:
You attempted to reference a variable in the binding or an instance variable
from a static context.
You misspelled a classname or statically imported field. Please check the
spelling.
You attempted to use a method 'Author' but left out brackets in a place not
allowed by the grammar.
> What we found so far is that this is somewhat cyclic in nature... meaning,
Book is looking for the Author class while the Author class is looking for the
Book class.
What version of the product are you using? On what operating system?
- Win7
- Grails 1.3.7
Please provide any additional information below.
-
Original issue reported on code.google.com by [email protected]
on 13 Dec 2011 at 10:29
Class
groovy.lang.MissingMethodException
Message
No signature of method: static com.foo.testapp.author.Author.list() is
applicable for argument types:
(org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap) values:
[[dc:com.foo.testapp.author.Author, action:list, ...]] Possible solutions:
is(java.lang.Object), wait(), find(), wait(long), with(groovy.lang.Closure),
use([Ljava.lang.Object;)
Around line 36 of
grails-app\controllers\org\grails\dynamicdomain\DdcController.groovy
33: def list = {
34: def domainClass = grailsApplication.getDomainClass(params.dc)
35: params.max = Math.min(params.max ? params.int('max') : 10, 100)
36: [domainInstanceList: domainClass.clazz.list(params),
37: domainInstanceTotal: domainClass.clazz.count(),
38: domainClass: domainClass]
39: }
Trace
Line | Method
->> 36 | doCall in DdcController.groovy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Original issue reported on code.google.com by [email protected]
on 11 Sep 2012 at 3:45
The _install script renames the current index.gsp and replaces it with one that
has the UI to create domain classes dynamically. This is cool for a demo, but
it only makes sense if you haven't edited your index.gsp yet. Most applications
will have customized it heavily.
Instead I'd suggest a new script that users can run after install which creates
a new GSP (with a different name that they choose) and also copies
DdcController.groovy to the project's grails-app/controllers directory instead
of being in the plugins's controllers directory. I think most users don't want
DdcController.groovy - it's good mostly for a demo.
DdcController.groovy is actually a significant security risk since it's
auto-mapped to the /appname/ddc URL and unless it's protected with security
will allow any user to create new domain classes.
Original issue reported on code.google.com by [email protected]
on 20 Nov 2010 at 2:38
What steps will reproduce the problem?
1. Choose a simple table with a not-null String as its ID:
CREATE TABLE WEATHER_STATES
(
WEATHER_STATE varchar2(2) NOT NULL,
WEATHER_STATE_DESC varchar2(50)
);
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('CL','Cloudy');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('CO','Cold');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('MC','Mostly Cloudy');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('OV','Overcast');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('PC','Partly Cloudy');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('RA','Raining');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('SN','Snowing');
INSERT INTO WEATHER_STATES (WEATHER_STATE,WEATHER_STATE_DESC) VALUES
('SU','Sunny');
2. Paste in domain class code:
package us.mn.state.dot.mnroad
class WeatherStates {
String weatherState
String weatherStateDesc
static constraints = {
weatherState(nullable:false, blank: false)
}
static mapping = {
id name:'weatherState'
version false
}
}
3. Generate the class and click the controller link.
What is the expected output?
- A list of weatherStates with links for each weatherState value.
What do you see instead?
A list with a blank ID column.
- See attached weatherStatesList.jpg
What version of the product are you using? On what operating system?
Grails 1.3.5 Windows XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 23 Dec 2010 at 7:18
Attachments:
[deleted issue]
What steps will reproduce the problem?
1. grails install-plugin dynamic-domain class
What is the expected output? What do you see instead?
Should see: Plugin installed successfully
instead see:
Executing dynamic-domain-class-0.2.1 plugin post-install script ...
Error installing plugin: Warning: Could not find file
/home/rvanderwerf/kpi-source/developerprogram/dynamic-domain-form/grails-app/vie
ws/index.gsp to copy.
[delete] Deleting directory /home/rvanderwerf/.grails/1.3.5/projects/dynamic-domain-form/plugins/dynamic-domain-class-0.2.1
What version of the product are you using? On what operating system?
0.2.1, Ubuntu 10.4 64 bit, Sun JDK 1.6_23, Grails 1.3.5
Please provide any additional information below.
Executing dynamic-domain-class-0.2.1 plugin post-install script ...
Error installing plugin: Warning: Could not find file
/home/rvanderwerf/kpi-source/developerprogram/dynamic-domain-form/grails-app/vie
ws/index.gsp to copy.
[delete] Deleting directory /home/rvanderwerf/.grails/1.3.5/projects/dynamic-domain-form/plugins/dynamic-domain-class-0.2.1
Original issue reported on code.google.com by [email protected]
on 4 Feb 2011 at 4:54
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.