jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

issue with jhipster-sample-app #2568

Closed mayurbais closed 8 years ago

mayurbais commented 8 years ago

I am trying to use this app for my POC, it used to work nicely..but latest build has some error... when I generate entity..it adds the entry of entity on top of master.xml in liquibase .. upon correction of this xml , when we run the app, and also the UI goes for a toss,

image

please help..I am fan of jhipster..but this is kinda a blocking me

pascalgrimaud commented 8 years ago

Can you give more information to reproduce your errors ? Clone jhipster-sample-app, then? What languages did you add? What entities etc?

mayurbais commented 8 years ago

then, do something like this:

yo jhipster:entity author

it will add a line : <include file="classpath:config/liquibase/changelog/20160104021420_added_entity_Author.xml" relativeToChangelogFile="false"/>

to master.xml at the top (i.e at line no 1. and not in tag ). If I correct this xml. and try to run the app using mvn spring-boot:run tomcat starts and I can access http://localhost:8080/#/ but, UI is not proper.. as shown in the screen shots in prev msgs.

Regards, Mayur (c)323-873-2822

On Sun, Jan 3, 2016 at 9:25 PM, Pascal Grimaud notifications@github.com wrote:

Can you give more information to reproduce your errors ? Clone jhipster-sample-app, then? What languages did you add? What entities etc?

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168585966 .

pascalgrimaud commented 8 years ago

Do you use the latest version of generator-jhipster ? 2.26.2 ?

pascalgrimaud commented 8 years ago

Here my master.xml file :

<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

    <include file="classpath:config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805124838_added_entity_BankAccount.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805124936_added_entity_Label.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805125054_added_entity_Operation.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20160104060529_added_entity_Author.xml" relativeToChangelogFile="false"/>
    <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
</databaseChangeLog>

I think in your master.xml file, you don't have this new <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here --> There are other needles too, so that's why your GUI is broken.

So, 2 possibilites:

See my PR : https://github.com/jhipster/generator-jhipster/pull/2474

When the needle is not found, the function write in util.js inserts the value at the beginning of the file, instead of displaying the error.

mayurbais commented 8 years ago

yes

when I do ," npm view generator-jhipster yo version" on my system I get : 2.26.2

Regards, Mayur (c)323-873-2822

On Sun, Jan 3, 2016 at 9:47 PM, Pascal Grimaud notifications@github.com wrote:

Do you use the latest version of generator-jhipster ? 2.26.2 ?

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168587587 .

mayurbais commented 8 years ago

I did not clone,

I just went on this link, https://github.com/jhipster/jhipster-sample-app and downloaded the zip.

Regards, Mayur (c)323-873-2822

On Sun, Jan 3, 2016 at 10:14 PM, Pascal Grimaud notifications@github.com wrote:

Here my master.xml file :

<?xml version="1.0" encoding="utf-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<include file="classpath:config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150805124838_added_entity_BankAccount.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150805124936_added_entity_Label.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150805125054_added_entity_Operation.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20160104060529_added_entity_Author.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->

I think in your master.xml file, you don't have this new

So, 2 possibilites:

  • you used an old version of generator-jhipster
  • you tried to update your clone project by merging, and it didn't add this new needle

See my PR : #2474 https://github.com/jhipster/generator-jhipster/pull/2474

When the needle is not found, the function write in util.js inserts the value at the beginning of the file, instead of displaying the error.

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168591130 .

pascalgrimaud commented 8 years ago

Can you show your master.xml file ?

mayurbais commented 8 years ago
<include file="classpath:config/liquibase/changelog/20160104021420_added_entity_SchoolDetails.xml" relativeToChangelogFile="false"/>
 <include file="classpath:config/liquibase/changelog/20160104021420_added_entity_CurrancyLOV.xml" relativeToChangelogFile="false"/>
<include   file="classpath:config/liquibase/changelog/20160104021420_added_entity_LanguageLOV.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20160104021420_added_entity_CountryLOV.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20160104021420_added_entity_ModuleLOV.xml" relativeToChangelogFile="false"/>
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

    <include file="classpath:config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805124838_added_entity_BankAccount.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805124936_added_entity_Label.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20150805125054_added_entity_Operation.xml" relativeToChangelogFile="false"/>
   <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
  </databaseChangeLog>
pascalgrimaud commented 8 years ago

One last thing to check : your jhipster-sample-app/node_modules/generator-jhipster/package.json, the version of generator-jhipster inside your project.

I didn't manage to reproduce your problem. I'm pretty sure your problem comes from an old version of the generator, globally or locally. It has been resolved since the 2.26.0 with https://github.com/jhipster/generator-jhipster/pull/2474

mayurbais commented 8 years ago

its this : "generator-jhipster": "2.26.2",

mayurbais commented 8 years ago

Is there any way I do a quick ,, live demo of what I am doing..? I am sure.. I am doing pretty simple things..

pascalgrimaud commented 8 years ago

Try:

mayurbais commented 8 years ago

okay..I will try ..but i am sure..it wont work.. the only thing I haven't done is using devbox. I will let you know, if it will work with that.

Thanks.

jdubois commented 8 years ago

jhipster-sample-app is the sample application, you're not supposed to use it to build your application directly, but use the generator. It definitely looks like a version issue, with a needle which has changed between the version that was used to generate the sample application, and the version of JHipster you currently use. Those needs to be the same version -> most of the time it will work fine anyway, but recently we have changed the "needles" system, which means you need to have the same version. You could download the latest sample version, do a merge, and this should work fine.

mayurbais commented 8 years ago

I have one question, When I generate the app using yo jhipster, it creats, node_modules folder with lot of files in it, But the jhipster-sample-app does not contains this folder. can you pls let me know how this app was generated?

pascalgrimaud commented 8 years ago

Just read the README.md It's npm install

mayurbais commented 8 years ago

I dont think you got my question..

see , I am trying to work my ways arround jhipster very hard...

From y'day I have unistalled the jhipster generator using npm uninstall generator-jhipster . and then installed again. and again then cloning the jhipster-sample-app. and trying to run the same.. I still get the same issue, about which I was complaining y'day.

The sole reason to use jhipster samle app was to get rid of node-modules folder

which gets generated when I use ..yo jhipster command.

you asked me do read readme file and use npm install.

What I did is , I created a new directory , navigated to that directory and did npm install. (which I wonder would be the right way or not).. lots of logs are shown on console , but directory is empty...

I am not sure..why you are not paying more close attention to it.. its really blocking me..

pls help!!

Regards, Mayur (c)323-873-2822

On Mon, Jan 4, 2016 at 10:53 PM, Pascal Grimaud notifications@github.com wrote:

Just read the README.md https://github.com/jhipster/jhipster-sample-app/blob/master/README.md It's npm install

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168918882 .

mayurbais commented 8 years ago

what I usually do is,

create a directory, navigate to it and do "yo jhipster", it asks me series of question, answer them and it creates, a folder structure in side my newly created directory, like this :

image

and when I saw "jhipster-sample-app" folder structure, I dont see presence of "node_modules"... which is exactly I want..

i,e I dont want "node_modules" module in my generated project structure...I want to know, how to do this?

atomfrede commented 8 years ago

node_modules is required to develop a jhipster app (using grunt or gulp for example). I think it is not under version control so its not in the sample app.

2016-01-05 9:14 GMT+01:00 mayurbais notifications@github.com:

what I usually do is,

create a directory, navigate to it and do "yo jhipster", it asks me series of question, answer them and it creates, a folder structure in side my newly created directory, like this :

[image: image] https://cloud.githubusercontent.com/assets/9245684/12110438/037066a4-b341-11e5-8d18-10ab9dcaf1db.png

and when I saw "jhipster-sample-app" folder structure, I dont see presence of "node_modules"... which is exactly I want..

i,e I dont want "node_modules" module in my generated project structure...I want to know, how to do this?

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168931567 .

mayurbais commented 8 years ago

then why does sample app gets build and runs properly.. and any which ways..I answer build tool as mvn (to one of the question that is asked during "yo jhipster ")

Regards, Mayur (c)323-873-2822

On Tue, Jan 5, 2016 at 12:17 AM, Frederik Hahne notifications@github.com wrote:

node_modules is required to develop a jhipster app (using grunt or gulp for example). I think it is not under version control so its not in the sample app.

2016-01-05 9:14 GMT+01:00 mayurbais notifications@github.com:

what I usually do is,

create a directory, navigate to it and do "yo jhipster", it asks me series of question, answer them and it creates, a folder structure in side my newly created directory, like this :

[image: image] < https://cloud.githubusercontent.com/assets/9245684/12110438/037066a4-b341-11e5-8d18-10ab9dcaf1db.png

and when I saw "jhipster-sample-app" folder structure, I dont see presence of "node_modules"... which is exactly I want..

i,e I dont want "node_modules" module in my generated project structure...I want to know, how to do this?

— Reply to this email directly or view it on GitHub < https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168931567

.

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168931898 .

deepu105 commented 8 years ago

Dude maven is for server build and hence it will run without npm and node_modules, if you run a production build then npm is required for grunt or gulp to work and for npm node_modules are required, the sample app is for reference and hence we dont check in node modules as it will be lots of files. On 5 Jan 2016 22:27, "mayurbais" notifications@github.com wrote:

then why does sample app gets build and runs properly.. and any which ways..I answer build tool as mvn (to one of the question that is asked during "yo jhipster ")

Regards, Mayur (c)323-873-2822

On Tue, Jan 5, 2016 at 12:17 AM, Frederik Hahne notifications@github.com wrote:

node_modules is required to develop a jhipster app (using grunt or gulp for example). I think it is not under version control so its not in the sample app.

2016-01-05 9:14 GMT+01:00 mayurbais notifications@github.com:

what I usually do is,

create a directory, navigate to it and do "yo jhipster", it asks me series of question, answer them and it creates, a folder structure in side my newly created directory, like this :

[image: image] <

https://cloud.githubusercontent.com/assets/9245684/12110438/037066a4-b341-11e5-8d18-10ab9dcaf1db.png

and when I saw "jhipster-sample-app" folder structure, I dont see presence of "node_modules"... which is exactly I want..

i,e I dont want "node_modules" module in my generated project structure...I want to know, how to do this?

— Reply to this email directly or view it on GitHub <

https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168931567

.

— Reply to this email directly or view it on GitHub < https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-168931898

.

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/2568#issuecomment-169015637 .