6.4 newly created page is not saving

Avatar

Avatar
Validate 1
Level 2
Sumanth-Narra
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Sumanth-Narra
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Sumanth-Narra
Level 2

06-02-2019

I'm creating a new project in AEM 6.4, got an instance from solution partner and building a basic component to read the sling model fields and converts the charters into upperCase.

I think there is no problem with the model, now I have created a page with using an existing template and author a new component on to page. when I build for the second time the page is showing 404 error and it's getting deleted from site admin.

Thanks

Sumanth

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

06-02-2019

Can you describe what you mean by saying when you build for a second time? Do you mean, when you drop a second component onto the page? Or do you mean, if you create a 2nd page with the same page template? 

A simple SLing Model component that injects a textfield into the model via @Inject annotation, then performs an uppercase operation on the string using Java, and displays the results in the component UI will not break an AEM page.

Avatar

Avatar
Validate 1
Level 2
Sumanth-Narra
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Sumanth-Narra
Level 2

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Sumanth-Narra
Level 2

06-02-2019

building second time means, I have some small changes in the model. then the page is disappearing in site admin. 

component.html

/*

<sly data-sly-test.nameExists="${properties.text1}"> formated text is ${properties.text1}</sly>

<sly data-sly-use.link="org.practice.aem.core.models.LinkModel">
  <pre> name comes from link field ${link.formatText}</pre>
</sly>

<sly data-sly-test="${!nameExists}">
  <pre>Please enter the name </pre>
</sly>

*/

model

/*

@Model(adaptables = Resource.class)

public class LinkModel {

   @Inject @Optional
   private String text1;


  private String formatText;

   @PostConstruct
   protected void init() {

   if(text1 != null){

   this.formatText = Character.toUpperCase(this.text1.charAt(0)) + this.text1.substring(1);
   }

  }

   public String getFormatText() {

   return formatText;
   }

}

*/

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

06-02-2019

Typically making a change to a component's Java logic does not result in a page disappearing.

If you make the change in Java - run:

mvn clean install

and then redeploy the OSGi bundle manually. The Java code will be updated and the Apps will not be overriden in the JCR.

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

06-02-2019

when does the page disappears? At the time of package installation? If yes, then check if you have "replace' specified for that content path in filter.xml of package?

Could you share relevant logs?

Avatar

Avatar
Validate 25
MVP
Himanshu_Singhal
MVP

Likes

65 likes

Total Posts

206 posts

Correct reply

23 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 25
MVP
Himanshu_Singhal
MVP

Likes

65 likes

Total Posts

206 posts

Correct reply

23 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile
Himanshu_Singhal
MVP

06-02-2019

You might have created a new project and every time you must be making full build. Since, the project created from AEM plugin contains sample content as well, during build, it overrides the content as well. That's the reason after build your content disappears.
Either make the partial build or remove "ui.content" module from project and everything shall work fine.

Best regards,
Himanshu Singhal