• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

is this tutorial outdated etc etc?

 
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

This is a continuation of my last post.  Basically, I am not getting any where studying the basic of what JSF and PrimeFace is about with the Pagination and LazyDataModel.

So far I have tried the



but when i tried mvn clean jetty:run -Pmyfaces22 as what the site said all I get is build failure



but when I tried mvn -version I am able to get



Then, I tried another tutorial


https://www.logicbig.com/tutorials/misc/primefaces/data-table-lazy-pagination.html



using Tomcat server 8.5 though but I can't get it render with



it is giving me 400 error.  Why ?

Now, I am studying this tutorial by Oracle i hope to know if this will be useful for me to understand what pagination and LazyDataModel how it works...and if there is any tutorial that works with PageBeans and the EntityBeans etc ?



really, after so many days I feel that I am doomed for sure...cos I really feel beaten and exhausted ...

Please help me on above. Tks.
 
Bartender
Posts: 653
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really have jdk installed?
 
Al Hobbs
Bartender
Posts: 653
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first one doesn't run right after compilation anyway so don't feel bad.
 
tangara goh
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Al Hobbs wrote:Do you really have jdk installed?



I tried the primeFacetest site on another computer and it works.
But, it is really a barebone app with nothing inside and it seems i have to copy the relevant codes to this barebones app and see how things work.

After going thru hours of diagnosis, I discoverd that my personal computer is like got multiple JDK, so the one when I tried to read it from that project folder doesn't point it to the system environment at the computer which has JDK 8 and when i did java -version at that project folder it shows JDK 11.



Default locale: en_SG, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"


C:\Users\xxx\primefaces-test-master\primefaces-test-master>java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

[/code]

so for the second tutorial,
I am adding the pom here so that you can let me know if there is anything wrong with the way I rendered on the browser :


http://localhost:8080/data-table-lazy-pagination-with-filtering-1.0-SNAPSHOT/index.xhtml


tks
 
Saloon Keeper
Posts: 26281
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDK that gets used here is whichever one your JAVA_HOME environment variable is set to when you run Maven.

It's worth noting that the Java versions indicated in your POM are the options used by the compiler and runtime, so the actual JDK that JAVA_HOME points to must be at least version 8, but can be a higher version, thanks to Java's backwards-compatibility feature.

And, as the error noted, JAVA_HOME must point to a JDK, and not a JRE. The JRE distros don't contain the javac compiler that jetty needs to use when compiling JSPs.
 
Bartender
Posts: 2244
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems like your Maven compiler is looking for JDK 8 instead of 11. Your original pom is :
<plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.6.1</version>
               <configuration>
                   <source>1.8</source>
                   <target>1.8</target>
                   <encoding>UTF-8</encoding>
               </configuration>
           </plugin>  

Can  you set 11 for <source> and <target>?
 
tangara goh
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:The JDK that gets used here is whichever one your JAVA_HOME environment variable is set to when you run Maven.

It's worth noting that the Java versions indicated in your POM are the options used by the compiler and runtime, so the actual JDK that JAVA_HOME points to must be at least version 8, but can be a higher version, thanks to Java's backwards-compatibility feature.

And, as the error noted, JAVA_HOME must point to a JDK, and not a JRE. The JRE distros don't contain the javac compiler that jetty needs to use when compiling JSPs.



I have set it to JDK I am very sure.  Please see https://i.imgur.com/h6SqUyn.png
 
tangara goh
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:It seems like your Maven compiler is looking for JDK 8 instead of 11. Your original pom is :
<plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.6.1</version>
               <configuration>
                   <source>1.8</source>
                   <target>1.8</target>
                   <encoding>UTF-8</encoding>
               </configuration>
           </plugin>  

Can  you set 11 for <source> and <target>?



I did as you said but I am still getting same error :

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
 
Saloon Keeper
Posts: 14498
325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:It seems like your Maven compiler is looking for JDK 8 instead of 11.


The source and target settings only affect the command line arguments that Maven sends to the compiler. They do not decide which compiler Maven uses.

The compiler that Maven uses is determined by the JAVA_HOME variable.

tangara goh wrote:I have set it to JDK I am very sure.


The JDK is on your PATH, but I have the suspicion that your JAVA_HOME variable points somewhere else. Please show us the value of the JAVA_HOME variable.
 
tangara goh
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I think the force was not with me but I managed to fix the JDK issue..but it is like too late cos I have wasted so many days...but THAN YOU SO MUCH FOR HELPING ME.
 
Tim Holloway
Saloon Keeper
Posts: 26281
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:It seems like your Maven compiler is looking for JDK 8 instead of 11.



No. As Stephan said, it's telling the Java compiler that Maven is running under to generate code for Java 8. The compatibility level is a command-line argument to the javac command. It's not going to look anywhere for any other version of Java, just tell Maven's Java what version to pretend to be.
 
tangara goh
Ranch Hand
Posts: 929
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Himai Minh wrote:It seems like your Maven compiler is looking for JDK 8 instead of 11.



No. As Stephan said, it's telling the Java compiler that Maven is running under to generate code for Java 8. The compatibility level is a command-line argument to the javac command. It's not going to look anywhere for any other version of Java, just tell Maven's Java what version to pretend to be.



I managed to fix it.  I guess it must be my exhaustion that causes all these what seems like a straightforward job yet I spent so much time on it.

Sorry guys to have you look into it...I know it can be taxing on you guys also...
 
Tim Holloway
Saloon Keeper
Posts: 26281
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eh, when Maven is good, it's very very good. But when it's bad…
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic