Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_EntityDTO.java error #1539

Closed
Jacek-Kurasiewicz opened this issue May 28, 2015 · 7 comments
Closed

_EntityDTO.java error #1539

Jacek-Kurasiewicz opened this issue May 28, 2015 · 7 comments
Milestone

Comments

@Jacek-Kurasiewicz
Copy link

Hi guys,

I just wanted report the following error while generating an entity:

yo jhipster:entity Client
The entity Client is being created.
Generating field #1
? Do you want to add a field to your entity? Yes
? What is the name of your field? cname
? What is the type of your field? String
? Do you want to add validation rules to your field? No
=================Client=================
cname (String)
Generating field #2
? Do you want to add a field to your entity? No
=================Client=================
cname (String)
Generating relationships with other entities
? Do you want to add a relationship to another entity? Yes
? What is the name of the other entity? Car
? What is the name of the relationship? carRelationship
? What is the type of the relationship? one-to-many
? What is the name of this relationship in the other entity? clientRelationship
===========Client==============

cname (String)

carRelationship - car (one-to-many)
Generating relationships with other entities
? Do you want to add a relationship to another entity? No
===========Client==============

cname (String)

carRelationship - car (one-to-many)
? Do you want to use a Data Transfer Object (DTO)? [BETA] Yes, generate a DTO with MapStruct
? Do you want pagination on your entity? Yes, with pagination links
Everything is configured, generating the entity...
/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:191
throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e
^
Error: Unable to read "/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/entity/templates/src/main/java/package/web/rest/dto/_EntityDTO.java" file (Error code: ENOENT).
at EntityGenerator.read (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:191:11)
at EntityGenerator.template (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:286:19)
at EntityGenerator.files (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/entity/index.js:829:14)
at /Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate as _immediateCallback

@jdubois
Copy link
Member

jdubois commented May 28, 2015

As you are using a DTO, I guess you are using directly the development version from the "master" branch?

I'm testing this right now

@jdubois
Copy link
Member

jdubois commented May 28, 2015

I just tested with the latest version and it works!

-> Can you do a git pull and test again? If it fails, please re-open the ticket

@jdubois jdubois closed this as completed May 28, 2015
@jdubois jdubois modified the milestone: 2.13.0 May 28, 2015
@Jacek-Kurasiewicz
Copy link
Author

Yes, I am working on master branch. I freshly cloned the master branch to make sure.

Unfortunately I am getting the same error:

$ yo jhipster:entity Client
The entity Client is being created.
Generating field #1
? Do you want to add a field to your entity? Yes
? What is the name of your field? cname
? What is the type of your field? String
? Do you want to add validation rules to your field? No
=================Client=================
cname (String)
Generating field #2
? Do you want to add a field to your entity? No
=================Client=================
cname (String)
Generating relationships with other entities
? Do you want to add a relationship to another entity? No
===========Client==============

cname (String)

? Do you want to use a Data Transfer Object (DTO)? [BETA] Yes, generate a DTO with MapStruct
? Do you want pagination on your entity? Yes, with pagination links
Everything is configured, generating the entity...
/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:191
throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e
^
Error: Unable to read "/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/entity/templates/src/main/java/package/web/rest/dto/_EntityDTO.java" file (Error code: ENOENT).
at EntityGenerator.read (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:191:11)
at EntityGenerator.template (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/actions/actions.js:286:19)
at EntityGenerator.files (/Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/entity/index.js:817:14)
at /Users/softpro/devel/workspaces/JHipster/testapp/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate as _immediateCallback

@jdubois
Copy link
Member

jdubois commented May 28, 2015

As you have a ENOENT it looks like the file can't be read, are you sure the file is here?

@Jacek-Kurasiewicz
Copy link
Author

You're right. The file is there. The Author of this code, possibly you, used lower case "Dto" as a template name:
generator-jhipster/entity/templates/src/main/java/package/web/rest/dto/_EntityDto.java

but references the template using upper case "DTO":
generator-jhipster/entity/templates/src/main/java/package/web/rest/dto/_EntityDTO.java

Most unix file systems unlike windows is case-sensitive.

I hope it will help to bugfix quickly.

@Jacek-Kurasiewicz
Copy link
Author

I changed locally _EntityDto.java to proper _EntityDTO.java and generation process worked fine.

I hope to be able to contribute soon. Just learning how to start coding with you, guys.

@jdubois
Copy link
Member

jdubois commented May 28, 2015

Oh yes this is my fault!!!!!!!
I originally used lower case, and then refactored. No problem on Unix, of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants