Re: data persistence using hibernate

2023-01-24 Thread Locke, Jonathan (Luo Shibo)
JOOQ is good for me most of the time.

Jon

On Jan 24, 2023, at 6:34 PM, James Pollard  wrote:

I don't need hibernates added level of abstraction

I was taught in the past to do database connectivity using jdbc
drivers/connectors, hikaricp just takes this a step further
by providing a pool of connections to use. Basically I've looked at orm
frameworks in the past and just couldn't get my
head around how to use it, I much prefer spelling out my query exactly
myself.

Best Regards
James Pollard
james.poll...@iinet.net.au

On 24/1/23 6:49 pm, Martin Grigorov wrote:
On Tue, Jan 24, 2023 at 8:50 AM James Pollard 
wrote:

I've managed to make some progress with database connectivity, ended up
using hikaricp instead

HikariCP is a just a connection pool.
I am not sure what exactly you mean with "instead". A connection pool is
not a replacement of an ORM framework like Hibernate.



However, I can't workout where the most appropriate place to put the
connection pool close call, is there a close or shutdown function
I can override so that the connection pool can be closed cleanly. I
haven't had any luck in my search so far

Additionally, I keep running into the following error:
 java.lang.IllegalStateException: Illegal access: this web
application instance has been stopped already.
Could not load [META-INF/services/org.mariadb.jdbc.plugin.Codec].
The following stack trace is thrown for debugging purposes as well as to
attempt to terminate the thread which caused the illegal access.

I'm assuming this is a error more to do hikaricp so I'll enquire among
their community about it, but if someone has encountered this before feel
to volunteer any suggestions or recommended actions. The odd thing is I
still seem to be able to send queries to the database from what I can
tell

MyWicketApplication#onDestroy()
https://github.com/apache/wicket/blob/4affb7b18424e40663239ac9c93d9ec33a432541/wicket-core/src/main/java/org/apache/wicket/Application.java#L569



Best Regards
James Pollard
james.poll...@iinet.net.au

On 27/12/22 8:23 am, Vit Rozkovec wrote:
But I'm not sure where to put the following parts
Session sess = sessionFactory.openSession();
ManagedSessionContext.bind(sess);
This is done in some utility method when you retrieve the session for
the first time in the request.

You should also check if the session is already bound by calling

ManagedSessionContext.hasBind(SessionFactory factory)

and binding it only once per request.


unbindSessionFactory
I have this in my custom implementation of
IRequestCycleListener.onEndRequest(RequestCycle cycle)

that you add in Application.init() method

getRequestCycleListeners().add(new DataRequestCycleListener());

To be honest, I've until now stayed away from Spring as it still seems
to me as a too much of a black box that I didn't find a time to invest
in learning it, so I may not be the right person to give you advice,
because my solution may not be the best one either, although it seems
to be as javadoc of the ManagedSessionContext suggests. The solution I
now use took heavy inspiration in old old, now nonexistent, Databinder
that came around the time Wicket 1.2 or so and when I was tasked to
select new java framework after landing my first job and found Wicket.
Old times :D.

Vit



Thank you for the help so far both of you, I've probably made
mistakes with implement parts
of the previously outlined process.
I've come from experimenting with javafx so wicket has been a radical
change of direction for me
so far. But since there is very little in the way of examples for
database integration I'm struggling
to get my head around how to implement it correctly, as well as
knowing for sure whether I've
done it correctly

Best Regards
James Pollard
james.poll...@iinet.net.au

On 23/12/22 10:16 am, Ernesto Reinaldo Barreiro wrote:
Hi James,

On Thu, Dec 22, 2022 at 2:24 PM James 
wrote:

Thanks for the guidance so far, that pointed me to find additional
resources on JPA
I believe I have this configured correctly, but I'm confused about how
to integrate JPA/Hibernate into a
pure wicket authenticated web application project since the
resource you
directed me to previously
seems to be more heavily on the spring side of things.

This is true. I have used Hibernate/JPA without the SpringBoot
parts... But
those projects are private: some owned by me, others no.


Thank you for accommodating all my questions and misunderstandings so
far, I tend to use a reverse
engineer learning style so it's helped me immensely.

Glad to be of some help. This is why this place is for.
I've included screenshots of the project file list and the application
class in the hopes that it makes

They didn't


understanding what I'm trying to convey easier

Best Regards
James Pollard
james.poll...@iinet.net.au

On 20/12/22 12:58 pm, Ernesto Reinaldo Barreiro wrote:


Re: Wicket on low end hardware

2023-01-03 Thread Locke, Jonathan (Luo Shibo)
One other little tidbit that could help. If you want to see when Hotspot 
compiles things, you can set the flag -XX:+PrintCompilation.

It would be nice if there was a way to force compilation of everything, but it 
doesn’t appear to be possible.

Best,

Jon


[social-Java-On-Baeldung-2.jpg]
Tiered Compilation in JVM
baeldung.com



On Jan 3, 2023, at 6:48 PM, Martin Terra  
wrote:

MartinG mentioned ComponentRenderer so if you know your pages, you could do
that.

If you need help with ComponentRenderer, please first proceed with it and
maybe a more specific question might help once you have gotten started.

**
Martin

ke 4. tammik. 2023 klo 2.23 Anna Eileen Eileen (shengchehs...@gmail.com)
kirjoitti:

Dear Martin

I don’t know how to do “pre-touch”, do you have any example?

From: Martin Terra 
Date: Tuesday, January 3, 2023 at 11:37 PM
To: s...@stantastic.nl 
Cc: users@wicket.apache.org 
Subject: Re: Wicket on low end hardware
Just a note, you don't need to make the startup "pre-touching" process a
blocking one so that if a user were to interact with the app, they could do
so while startup pretouch is doing its thing.

And you could profile whether you want to do the pre-touch in single thread
or multi-thraded.

**
Martin

ti 3. tammik. 2023 klo 16.58 s...@stantastic.nl kirjoitti:

Thanks everyone. I did not expect the amount of feedback that I got. It
is much appreciated.

I spent most of my day profiling with VisualVM and it strengthened by
beliefs that my problems do not appear to be related to anything but
Wicket combined with our dated hardware. Please do not consider this a
criticism. I understand that not a lot of people run servlet containers
on this kind of hardware nowadays.

My database queries all run quickly and my domain classes are hardly
even touched when the system starts. Our rather simple login page -
which is stateless and does not query the database when the form is
empty - takes 5-15 seconds to load on the first try. Subsequent requests
take about 40-120ms (browser caching disabled). Once logged in, the
other pages do not take as long, but they do feel sluggish until they
have been requested once.

I tried to only load the quickstart example as Martijn suggested. It
starts more quickly than our own application but all things considered,
its performance did not impress me and that application really is super
simple. The first page load of the quickstart took about 2 seconds,
after that it normalized to about 30ms per request.

When all pages have been loaded once, things are absolutely fine. So I
am considering Martin's approach of preloading components. That still
leaves me with the considerable startup time but we will learn to live
with that. Or we might switch from Tomcat to Jetty eventually.

If anyone thinks I might be leaving some stuff on the table, I would be
open to hire someone to do some consulting work on this. Please get in
touch with me if you are interested.

Cheers.

Stan


Martin Terra schreef op 2023-01-02 04:29:

Anything in wicket can be preloaded,  but as premature optimization is
evil, you should profile your application.

If you do not have debug access to a real/simulated environment then
the
least you can do is make your own thread logger to log what the threads
are
doing.

**
Martin

ma 2. tammik. 2023 klo 3.19 Anna Eileen (shengchehs...@gmail.com)
kirjoitti:

Hello

Would you please describe your web application components? Database ?
What services ran on the device?

From: s...@stantastic.nl 
Date: Monday, January 2, 2023 at 5:23 AM
To: users@wicket.apache.org 
Subject: Wicket on low end hardware

Hi,

My use case for Wicket is a quite unconventional one. I use it as the
framework for the web interface of an appliance that runs on low end
hardware. The appliance doesn't have gigabytes of memory to waste or
tens of CPU cores. It's more like Celeron powered hardware with maybe
one or two gigabytes of RAM.

I general this all works and customers are happy once the device is
running. But I find that deployment is quite slow, and so are the
first
couple of page loads of the day. Just to be clear: I cannot really
claim
that my performance problems are all Wicket related. They may be, but
they probably also are down to other underlying issues. A badly
optimized database, or a badly configured servlet container come to
mind...

However, I was wondering if anyone has experience in using Wicket on
low
end hardware. I would be very interested in how to optimize for this.

Thanks,

Stan


[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.



Re: Wicket on low end hardware

2023-01-02 Thread Locke, Jonathan (Luo Shibo)
Jetty starts up quite a bit faster than Tomcat, so that’s an option too.

Jon

On Jan 2, 2023, at 12:51 PM, Martijn Dashorst  
wrote:

As a simple test you could deploy a Wicket quick start to the device (make
sure it runs in deployment mode) to see if it still is slow. If that is the
case, you might need to look at the memory available for Tomcat. It might
need a bit more than it is configured with. Tweaking the memory settings
might also make a difference. If it is a low end device, it probably is
running the serialGC, you may need to switch to a different one like g1gc.
I've noticed that using "-XmxNg -XmsNg", where keeping N the same for
minimum and maximum shaves a lot of time from the GC, as it doesn't try to
minimize memory consumption.

Another thing you might look into is whether the application gets deployed
by Tomcat after the first request, or prior to that. (see Tomcat's
configuration for "deployOnStartup")

Martijn


On Mon, Jan 2, 2023 at 6:26 PM mailto:s...@stantastic.nl>> 
wrote:

It is not a very special setup.

All devices run a Tomcat 9 servlet container. The servlet container runs
a webservice that is being used onsite by other systems and an
administration UI which is Wicket based. Both apps use the same H2
database, which is tiny (<1MB) and only contains configuration and small
amounts of temporary data. The data layer is based on MyBatis, and
besides that there only are a couple of our own libraries there, and
those really only contain some domain logic. The heavy lifting happens
in the other app.

Typical boot time for the servlet container is 10 to 20 seconds,
depending on the hardware (it is about 4 seconds on my development
machine). Which - isn't a lot if you ask me, but it annoys our support
staff when they have to update the devices. And they probably do this a
lot on a daily basis.

When the first page of the day is requested it can take a good 5-15
seconds for it to appear, even when the device has already been running
for most of the day. On my development machine it is nearly instant.

The Wicket application's performance does not improve when it is the
only app being run on the device.

But you and Martin are spot on. Instead of hoping for the golden lottery
ticket, it is probably better for me to just spend half a day profiling
and then ask a well researched question. So I guess I figured out what
I'll be doing tomorrow morning ;-).

Thanks!

Stan


Anna Eileen schreef op 2023-01-02 02:19:

Hello

Would you please describe your web application components? Database ?
What services ran on the device?

From: s...@stantastic.nl 
Date: Monday, January 2, 2023 at 5:23 AM
To: users@wicket.apache.org 
Subject: Wicket on low end hardware

Hi,

My use case for Wicket is a quite unconventional one. I use it as the
framework for the web interface of an appliance that runs on low end
hardware. The appliance doesn't have gigabytes of memory to waste or
tens of CPU cores. It's more like Celeron powered hardware with maybe
one or two gigabytes of RAM.

I general this all works and customers are happy once the device is
running. But I find that deployment is quite slow, and so are the first
couple of page loads of the day. Just to be clear: I cannot really
claim
that my performance problems are all Wicket related. They may be, but
they probably also are down to other underlying issues. A badly
optimized database, or a badly configured servlet container come to
mind...

However, I was wondering if anyone has experience in using Wicket on
low
end hardware. I would be very interested in how to optimize for this.

Thanks,

Stan

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



--
Become a Wicket expert, learn from the best: 
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwicketinaction.com=E,1,f7QZv9TsdLd7FR2mmJNPb_CRjfQP1ZjeTQiPc-70BW1VzBB_LPj1UcHuDhbe__2o8suTqiYoi7ZQ_cVaxAe2V-fyJ-HrIyFB8XkvfWk1ECxj=1
[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.



Re: module error

2022-02-21 Thread Locke, Jonathan (Luo Shibo)
Thanks, Andrea.

Well, given that Wicket doesn't seem to work in modular Java due to a missing 
'uses' statement, I think we should push out a release with that one change in 
it so other people don't run into this issue. Does it make sense? I'd be happy 
to help out so I can learn how we push releases these days. In addition to the 
benefit to modular Java users, once this release is out, I can release KivaKit 
with a new Wicket integration feature and a Medium article about it. The 
feature makes Wicket very turn-key (a single one-line method gets things going).

Best,

Jon


From: Andrea Del Bene 
Sent: Monday, February 21, 2022 3:54 AM
To: users@wicket.apache.org 
Subject: Re: module error

Hi everyone and welcome back Jonathan (not that you ever ever really left
:-) )! I checked your committer account and it looks ok. Your configured
github account is this https://github.com/jonathanlocke/. I think Maxim is
right, you should check gitbox to be sure that your github account has the
appropriate rights.
The release instructions are sadly too outdated. Fortunately most of the
work now is automatically done with scripts 
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2f%2f%2frelease.sh%2fpromote.sh.=E,1,-__seuu5VWssqXUmme_xBuxoCly_APGotrMLSep9xQCSTZ-5PfYZPV3QFa9__ZmfOh7IAbyDy1OsRL4NS-DO3fx9frBfVWIUTTOKatjJRs-o6ZqzD6bUTw,,=1
 I can
update the information page but at the moment I don't know when I will find
the time to do it. Of course if we want to rollout a new release I can
start the process asap.

On Mon, Feb 21, 2022 at 5:11 AM Martin Grigorov 
wrote:

> Hi Jon,
>
> Once you link your ASF account with your GitHub account please read our
> "How to release" document -
> https://wicket.apache.org/contribute/release.html. It is a bit outdated it
> seems.
>
>  I'd let Andrea del Bene make a release. Or at least work closely with him
> for my first attempt to release.
>
> On Mon, Feb 21, 2022, 05:12 Locke, Jonathan (Luo Shibo) <
> jonath...@telenav.com> wrote:
>
> > Hi Martin,
> >
> > I have access to my account now, but I get this when I try to push a new
> > branch rel/wicket-9.8.1
> >
> > wicket: remote: Permission to apache/wicket.git denied to jonathanlocke.
> > unable to access 'https://github.com/apache/wicket.git/': The requested
> > URL returned error: 403
> >
> > Can someone give me push access?
> >
> >Jon
> >
> > 
> > From: Martin Grigorov 
> > Sent: Sunday, February 20, 2022 5:58 PM
> > To: users@wicket.apache.org 
> > Subject: Re: module error
> >
> > You are still a member of the team -
> > https://home.apache.org/phonebook.html?uid=jonl
> >
> > If your login was disabled your id would appear scratched at
> > https://home.apache.org/phonebook.html?pmc=wicket
> >
> > I guess you have forgotten your ID and/or associated email and/or
> password.
> > The quickest way to start using again your account is to contact Infra
> team
> > at JIRA.
> >
> >
> > Once you have access to your Apache account you should go to
> > https://gitbox.apache.org/setup/ to link it with your GitHub account.
> >
> >
> >
> > On Sun, Feb 20, 2022, 08:00 Locke, Jonathan (Luo Shibo) <
> > jonath...@telenav.com> wrote:
> >
> > > Yes, I checked. I don't.
> > > 
> > > From: Maxim Solodovnik 
> > > Sent: Saturday, February 19, 2022 8:11 PM
> > > To: users@wicket.apache.org 
> > > Subject: Re: module error
> > >
> > > from mobile (sorry for typos ;)
> > >
> > >
> > > On Sun, Feb 20, 2022, 02:41 Locke, Jonathan (Luo Shibo) <
> > > jonath...@telenav.com> wrote:
> > >
> > > > I don't think I'm a committer anymore. It's been at least a decade
> > since
> > > > my last commit.
> > > >
> > >
> > > Commitership shouldn't be dropped due to inactivity
> > >
> > > Can you check if you have your github login at id.apache.org ?
> > >
> > >
> > > I'm amazed that wicket is still going strong. In two years it will be
> 20
> > > > years of Wicket.
> > > >
> > > >Jon
> > > >
> > > > 
> > > > From: Maxim Solodovnik 
> > > > Sent: Saturday, February 19, 2022 5:57 AM
> > > > To: users@wicket.apache.org 
> > > > Subject: Re: module error
> > > >
> > > > from mobile (sorry for typos ;)
> > > >
> > > >
> > > > On Sa

Re: module error

2022-02-20 Thread Locke, Jonathan (Luo Shibo)
Hi Martin,

I have access to my account now, but I get this when I try to push a new branch 
rel/wicket-9.8.1

wicket: remote: Permission to apache/wicket.git denied to jonathanlocke. unable 
to access 'https://github.com/apache/wicket.git/': The requested URL returned 
error: 403

Can someone give me push access?

   Jon


From: Martin Grigorov 
Sent: Sunday, February 20, 2022 5:58 PM
To: users@wicket.apache.org 
Subject: Re: module error

You are still a member of the team -
https://home.apache.org/phonebook.html?uid=jonl

If your login was disabled your id would appear scratched at
https://home.apache.org/phonebook.html?pmc=wicket

I guess you have forgotten your ID and/or associated email and/or password.
The quickest way to start using again your account is to contact Infra team
at JIRA.


Once you have access to your Apache account you should go to
https://gitbox.apache.org/setup/ to link it with your GitHub account.



On Sun, Feb 20, 2022, 08:00 Locke, Jonathan (Luo Shibo) <
jonath...@telenav.com> wrote:

> Yes, I checked. I don't.
> 
> From: Maxim Solodovnik 
> Sent: Saturday, February 19, 2022 8:11 PM
> To: users@wicket.apache.org 
> Subject: Re: module error
>
> from mobile (sorry for typos ;)
>
>
> On Sun, Feb 20, 2022, 02:41 Locke, Jonathan (Luo Shibo) <
> jonath...@telenav.com> wrote:
>
> > I don't think I'm a committer anymore. It's been at least a decade since
> > my last commit.
> >
>
> Commitership shouldn't be dropped due to inactivity
>
> Can you check if you have your github login at id.apache.org ?
>
>
> I'm amazed that wicket is still going strong. In two years it will be 20
> > years of Wicket.
> >
> >Jon
> >
> > 
> > From: Maxim Solodovnik 
> > Sent: Saturday, February 19, 2022 5:57 AM
> > To: users@wicket.apache.org 
> > Subject: Re: module error
> >
> > from mobile (sorry for typos ;)
> >
> >
> > On Sat, Feb 19, 2022, 19:20 Ernesto Reinaldo Barreiro <
> reier...@gmail.com>
> > wrote:
> >
> > > No if you are a committer :-)
> > >
> >
> > Commiter will never see 403 :)
> >
> > >
> > > On Fri, Feb 18, 2022 at 11:44 PM Maxim Solodovnik <
> solomax...@gmail.com>
> > > wrote:
> > >
> > > > On Sat, 19 Feb 2022 at 03:04, Locke, Jonathan (Luo Shibo) <
> > > > jonath...@telenav.com> wrote:
> > > >
> > > > > Hi Martin,
> > > > >
> > > > > I was able to fix the problem as you suggested by adding:
> > > > >
> > > > > uses org.apache.wicket.IInitializer;
> > > > >
> > > > > to
> >
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmodule-info.java=E,1,WO4T_dAL8ww57jzExgL1QE2YUg9PSzf2JkCUtz233hgGolAnoaigRG7sFCy0R4-qUwC5-Hx7dj3RPzsVYEU2af8Pfa75fVWyNkUJcZk3X0YerNK-FcxQ=1
> > in wicket-core. I created a pull request, but got
> > > an
> > > > > error trying to push it in IntelliJ:
> > > > >
> > > > > Can't create a new pull request: Push failed: remote: Permission to
> > > > > apache/wicket.git denied to jonathanlocke. unable to access '
> > > > > https://github.com/apache/wicket.git/': The requested URL returned
> > > > error:
> > > > > 403
> > > > >
> > > >
> > > > You need to fork the repo first :)
> > > >
> > > >
> > > > >
> > > > > Could we add this as a patch release to wicket 9.8.x?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jon
> > > > > 
> > > > > From: Martin Grigorov 
> > > > > Sent: Friday, February 18, 2022 2:55 AM
> > > > > To: users@wicket.apache.org 
> > > > > Subject: Re: module error
> > > > >
> > > > > Hm.
> > > > > Looking at https://github.com/qos-ch/logback/commit/5186d2604b460f
> I
> > > > think
> > > > > we need the 'uses' only in the module where we call
> > > ServiceLoader.load(),
> > > > > i.e. in wicket-core.
> > > > >
> > > > > On Fri, Feb 18, 2022 at 11:53 AM Martin Grigorov <
> > mgrigo...@apache.org
> > > >
> > > > > wrote:
> > > > >
> > > > > > Hi Jon,
> > > > > >
> > > > > > According to
> > > > > >
> >

Re: module error

2022-02-19 Thread Locke, Jonathan (Luo Shibo)
Yes, I checked. I don't.

From: Maxim Solodovnik 
Sent: Saturday, February 19, 2022 8:11 PM
To: users@wicket.apache.org 
Subject: Re: module error

from mobile (sorry for typos ;)


On Sun, Feb 20, 2022, 02:41 Locke, Jonathan (Luo Shibo) <
jonath...@telenav.com> wrote:

> I don't think I'm a committer anymore. It's been at least a decade since
> my last commit.
>

Commitership shouldn't be dropped due to inactivity

Can you check if you have your github login at id.apache.org ?


I'm amazed that wicket is still going strong. In two years it will be 20
> years of Wicket.
>
>Jon
>
> 
> From: Maxim Solodovnik 
> Sent: Saturday, February 19, 2022 5:57 AM
> To: users@wicket.apache.org 
> Subject: Re: module error
>
> from mobile (sorry for typos ;)
>
>
> On Sat, Feb 19, 2022, 19:20 Ernesto Reinaldo Barreiro 
> wrote:
>
> > No if you are a committer :-)
> >
>
> Commiter will never see 403 :)
>
> >
> > On Fri, Feb 18, 2022 at 11:44 PM Maxim Solodovnik 
> > wrote:
> >
> > > On Sat, 19 Feb 2022 at 03:04, Locke, Jonathan (Luo Shibo) <
> > > jonath...@telenav.com> wrote:
> > >
> > > > Hi Martin,
> > > >
> > > > I was able to fix the problem as you suggested by adding:
> > > >
> > > > uses org.apache.wicket.IInitializer;
> > > >
> > > > to
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmodule-info.java=E,1,WO4T_dAL8ww57jzExgL1QE2YUg9PSzf2JkCUtz233hgGolAnoaigRG7sFCy0R4-qUwC5-Hx7dj3RPzsVYEU2af8Pfa75fVWyNkUJcZk3X0YerNK-FcxQ=1
> in wicket-core. I created a pull request, but got
> > an
> > > > error trying to push it in IntelliJ:
> > > >
> > > > Can't create a new pull request: Push failed: remote: Permission to
> > > > apache/wicket.git denied to jonathanlocke. unable to access '
> > > > https://github.com/apache/wicket.git/': The requested URL returned
> > > error:
> > > > 403
> > > >
> > >
> > > You need to fork the repo first :)
> > >
> > >
> > > >
> > > > Could we add this as a patch release to wicket 9.8.x?
> > > >
> > > > Thanks,
> > > >
> > > > Jon
> > > > 
> > > > From: Martin Grigorov 
> > > > Sent: Friday, February 18, 2022 2:55 AM
> > > > To: users@wicket.apache.org 
> > > > Subject: Re: module error
> > > >
> > > > Hm.
> > > > Looking at https://github.com/qos-ch/logback/commit/5186d2604b460f I
> > > think
> > > > we need the 'uses' only in the module where we call
> > ServiceLoader.load(),
> > > > i.e. in wicket-core.
> > > >
> > > > On Fri, Feb 18, 2022 at 11:53 AM Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > Hi Jon,
> > > > >
> > > > > According to
> > > > >
> > > >
> > >
> >
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.oracle.com%2fcorporate%2ffeatures%2funderstanding-java-9-modules.html=E,1,AlcuJddqQ1zhtdsihzDbje23huNpDs6zcgn19JZMXP_Y1UGGpZLts-DudDYPcu75JyHkjFHLNGJw3KmnkhBiyTndIjuRNCIVCuhKfLjxxCsCSVE,=1
> > > > >
> > > > > *provides…with.* A provides…with module directive specifies that a
> > > module
> > > > > provides a service implementation—making the module a *service
> > > provider*.
> > > > > The provides part of the directive specifies an interface or
> abstract
> > > > > class listed in a module’s uses directive and the with part of the
> > > > > directive specifies the name of the service provider class that
> > > > implements
> > > > > the interface or extends the abstract class.
> > > > >
> > > > > AFAIU it we need to add "uses org.apache.wicket.IInitializer" next
> to
> > > all
> > > > > "provides org.apache.wicket.IInitializer with
> > > x.y.z.SomeImplementation;"
> > > > >
> > > > > Please try it and if it fixes the issue then send a PR!
> > > > >
> > > > > On Thu, Feb 17, 2022 at 8:16 PM Locke, Jonathan (Luo Shibo) <
> > > > > jonath...@telenav.com> wrote:
> > > > >
> > > > >>
> > > > >> Does anyone know what this is? Thank

Re: module error

2022-02-19 Thread Locke, Jonathan (Luo Shibo)
I don't think I'm a committer anymore. It's been at least a decade since my 
last commit.
I'm amazed that wicket is still going strong. In two years it will be 20 years 
of Wicket.

   Jon


From: Maxim Solodovnik 
Sent: Saturday, February 19, 2022 5:57 AM
To: users@wicket.apache.org 
Subject: Re: module error

from mobile (sorry for typos ;)


On Sat, Feb 19, 2022, 19:20 Ernesto Reinaldo Barreiro 
wrote:

> No if you are a committer :-)
>

Commiter will never see 403 :)

>
> On Fri, Feb 18, 2022 at 11:44 PM Maxim Solodovnik 
> wrote:
>
> > On Sat, 19 Feb 2022 at 03:04, Locke, Jonathan (Luo Shibo) <
> > jonath...@telenav.com> wrote:
> >
> > > Hi Martin,
> > >
> > > I was able to fix the problem as you suggested by adding:
> > >
> > > uses org.apache.wicket.IInitializer;
> > >
> > > to 
> > > https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmodule-info.java=E,1,WO4T_dAL8ww57jzExgL1QE2YUg9PSzf2JkCUtz233hgGolAnoaigRG7sFCy0R4-qUwC5-Hx7dj3RPzsVYEU2af8Pfa75fVWyNkUJcZk3X0YerNK-FcxQ=1
> > >  in wicket-core. I created a pull request, but got
> an
> > > error trying to push it in IntelliJ:
> > >
> > > Can't create a new pull request: Push failed: remote: Permission to
> > > apache/wicket.git denied to jonathanlocke. unable to access '
> > > https://github.com/apache/wicket.git/': The requested URL returned
> > error:
> > > 403
> > >
> >
> > You need to fork the repo first :)
> >
> >
> > >
> > > Could we add this as a patch release to wicket 9.8.x?
> > >
> > > Thanks,
> > >
> > > Jon
> > > 
> > > From: Martin Grigorov 
> > > Sent: Friday, February 18, 2022 2:55 AM
> > > To: users@wicket.apache.org 
> > > Subject: Re: module error
> > >
> > > Hm.
> > > Looking at https://github.com/qos-ch/logback/commit/5186d2604b460f I
> > think
> > > we need the 'uses' only in the module where we call
> ServiceLoader.load(),
> > > i.e. in wicket-core.
> > >
> > > On Fri, Feb 18, 2022 at 11:53 AM Martin Grigorov  >
> > > wrote:
> > >
> > > > Hi Jon,
> > > >
> > > > According to
> > > >
> > >
> >
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.oracle.com%2fcorporate%2ffeatures%2funderstanding-java-9-modules.html=E,1,AlcuJddqQ1zhtdsihzDbje23huNpDs6zcgn19JZMXP_Y1UGGpZLts-DudDYPcu75JyHkjFHLNGJw3KmnkhBiyTndIjuRNCIVCuhKfLjxxCsCSVE,=1
> > > >
> > > > *provides…with.* A provides…with module directive specifies that a
> > module
> > > > provides a service implementation—making the module a *service
> > provider*.
> > > > The provides part of the directive specifies an interface or abstract
> > > > class listed in a module’s uses directive and the with part of the
> > > > directive specifies the name of the service provider class that
> > > implements
> > > > the interface or extends the abstract class.
> > > >
> > > > AFAIU it we need to add "uses org.apache.wicket.IInitializer" next to
> > all
> > > > "provides org.apache.wicket.IInitializer with
> > x.y.z.SomeImplementation;"
> > > >
> > > > Please try it and if it fixes the issue then send a PR!
> > > >
> > > > On Thu, Feb 17, 2022 at 8:16 PM Locke, Jonathan (Luo Shibo) <
> > > > jonath...@telenav.com> wrote:
> > > >
> > > >>
> > > >> Does anyone know what this is? Thanks -- Jon
> > > >>
> > > >> Exception in thread "main" java.util.ServiceConfigurationError:
> > > >> org.apache.wicket.IInitializer: module org.apache.wicket.core does
> not
> > > >> declare `uses`
> > > >> at java.base/
> > >
> >
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fjava.util.ServiceLoader.fail=E,1,2x_TAvfY-cjOXXMq-PK1WQZp3HpRsfitQcisq2lSSdigHB1fuLg4Un_Ch3NVlsHPuGsx1r8PejxwY0JdlGRrY2C2drem7b8IxqPf8rSvijXa9Q,,=1(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a589=E,1,cis_qtCg_hnDhiLzgOVbloD3TvvURxsW_mR8jY_GLJSaBpOtuXQJUWKaJ_JrPr61_00oAuYKmsG399grMpFwMKTC0mk8-ulQZF8Om98TsswwCgflaQ,,=1)
> > > >> at java.base/java.util.ServiceLoader.checkCaller(
> > >
> >
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a575=E,1,9qC3hJZa-Ru3NfQ0Cu_xyUf_1TZj3k6pzwnMObpxVdF9nmaNB2Rc-7lJtCo

Re: module error

2022-02-18 Thread Locke, Jonathan (Luo Shibo)
Hi Martin,

I was able to fix the problem as you suggested by adding:

uses org.apache.wicket.IInitializer;

to module-info.java in wicket-core. I created a pull request, but got an error 
trying to push it in IntelliJ:

Can't create a new pull request: Push failed: remote: Permission to 
apache/wicket.git denied to jonathanlocke. unable to access 
'https://github.com/apache/wicket.git/': The requested URL returned error: 403

Could we add this as a patch release to wicket 9.8.x?

Thanks,

Jon

From: Martin Grigorov 
Sent: Friday, February 18, 2022 2:55 AM
To: users@wicket.apache.org 
Subject: Re: module error

Hm.
Looking at https://github.com/qos-ch/logback/commit/5186d2604b460f I think
we need the 'uses' only in the module where we call ServiceLoader.load(),
i.e. in wicket-core.

On Fri, Feb 18, 2022 at 11:53 AM Martin Grigorov 
wrote:

> Hi Jon,
>
> According to
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.oracle.com%2fcorporate%2ffeatures%2funderstanding-java-9-modules.html=E,1,AlcuJddqQ1zhtdsihzDbje23huNpDs6zcgn19JZMXP_Y1UGGpZLts-DudDYPcu75JyHkjFHLNGJw3KmnkhBiyTndIjuRNCIVCuhKfLjxxCsCSVE,=1
>
> *provides…with.* A provides…with module directive specifies that a module
> provides a service implementation—making the module a *service provider*.
> The provides part of the directive specifies an interface or abstract
> class listed in a module’s uses directive and the with part of the
> directive specifies the name of the service provider class that implements
> the interface or extends the abstract class.
>
> AFAIU it we need to add "uses org.apache.wicket.IInitializer" next to all
> "provides org.apache.wicket.IInitializer with x.y.z.SomeImplementation;"
>
> Please try it and if it fixes the issue then send a PR!
>
> On Thu, Feb 17, 2022 at 8:16 PM Locke, Jonathan (Luo Shibo) <
> jonath...@telenav.com> wrote:
>
>>
>> Does anyone know what this is? Thanks -- Jon
>>
>> Exception in thread "main" java.util.ServiceConfigurationError:
>> org.apache.wicket.IInitializer: module org.apache.wicket.core does not
>> declare `uses`
>> at 
>> java.base/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fjava.util.ServiceLoader.fail=E,1,2x_TAvfY-cjOXXMq-PK1WQZp3HpRsfitQcisq2lSSdigHB1fuLg4Un_Ch3NVlsHPuGsx1r8PejxwY0JdlGRrY2C2drem7b8IxqPf8rSvijXa9Q,,=1(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a589=E,1,cis_qtCg_hnDhiLzgOVbloD3TvvURxsW_mR8jY_GLJSaBpOtuXQJUWKaJ_JrPr61_00oAuYKmsG399grMpFwMKTC0mk8-ulQZF8Om98TsswwCgflaQ,,=1)
>> at 
>> java.base/java.util.ServiceLoader.checkCaller(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a575=E,1,9qC3hJZa-Ru3NfQ0Cu_xyUf_1TZj3k6pzwnMObpxVdF9nmaNB2Rc-7lJtCoeo-It3FF8Ycad-exairuNw8NewoRyu6p0DmFxGH3lEQdd=1)
>> at 
>> java.base/java.util.ServiceLoader.(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a504=E,1,cG_JOkZF6cVpHdKnhFXnJdubZajDowT1aiqJ9nZMqXb8XP1HyPF8zffkOEW6pB1tIpgfKXetT1e_Av2K_LQiQ4IawQx7L_1ecDlhhxbW-A,,=1)
>> at 
>> java.base/java.util.ServiceLoader.load(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fServiceLoader.java%3a1687=E,1,ygqiqrdRgnPTbUdIwfyfaUU7NeLViUlaxe25c2cEr4ugbgFscntOvbGkTMrOa6kItGqMQ8hU1VDEzNaoKdV3-6CvBlcsrRFxlFuwjq6IqJK4Z_uzDIyI=1)
>> at org.apache.wicket.core@9.6.0
>> /org.apache.wicket.Application.initInitializers(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fApplication.java%3a556=E,1,xO9MV3KborBvFc4BL8FxC_4uuwfGaJqvrr-QVfntZI9iuOSmldotcVrEPvDYOTDHJI2hraMPQKQ5UOmqIxeJinkgxDyfchFVTm-AleqRwae6OLPTDfo,=1)
>> at org.apache.wicket.core@9.6.0
>> /org.apache.wicket.Application.initApplication(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fApplication.java%3a765=E,1,53VvaIOZTG7mETf35tkUcXDXfgaVHqiw29gxxq_4y_ZXHn8AGzbIbtFXR4tf6Oh_rbl7mOLXjgPBeEW3-pd7jBqEp-30i2WA26_CdN5uIVJtHsjBDJuep4DVDA,,=1)
>> at org.apache.wicket.core@9.6.0
>> /org.apache.wicket.protocol.http.WicketFilter.init(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fWicketFilter.java%3a441=E,1,He0Z2RxpNcC-ziRHqyjYFORYOn-LK_eNOZGT9zHWjBKPv3GAhtI8TUG2W-9YOiYdW6_ArVy_6GMjKIt_0nLh3u0FHuh0H-pscUXDZj11B8s,=1)
>> at org.apache.wicket.core@9.6.0
>> /org.apache.wicket.protocol.http.WicketFilter.init(https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fWicketFilter.java%3a365=E,1,yo_2tJnAV4qbr-cq49OMx3sq4HWonvaqycQkJ_db-wYcUtt-8EyuDB-_tz0hjwH9lQgYN9mHJniiRilRX9pL2VXbKQEd6QnNcrLzbwVOzRzTSmM,=1)
>>
>>
[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.


module error

2022-02-17 Thread Locke, Jonathan (Luo Shibo)

Does anyone know what this is? Thanks -- Jon

Exception in thread "main" java.util.ServiceConfigurationError: 
org.apache.wicket.IInitializer: module org.apache.wicket.core does not declare 
`uses`
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
at java.base/java.util.ServiceLoader.checkCaller(ServiceLoader.java:575)
at java.base/java.util.ServiceLoader.(ServiceLoader.java:504)
at java.base/java.util.ServiceLoader.load(ServiceLoader.java:1687)
at 
org.apache.wicket.core@9.6.0/org.apache.wicket.Application.initInitializers(Application.java:556)
at 
org.apache.wicket.core@9.6.0/org.apache.wicket.Application.initApplication(Application.java:765)
at 
org.apache.wicket.core@9.6.0/org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:441)
at 
org.apache.wicket.core@9.6.0/org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:365)



Re: servlet api "BigBang"

2022-02-02 Thread Locke, Jonathan (Luo Shibo)
If the community likes the idea, it would be possible to migrate Wicket to 
KivaKit logging (and status messaging).

https://state-of-the-art.org/2021/08/17/logging.html
https://medium.com/@jonathanlocke/why-messaging-is-a-better-way-to-report-status-2badb679345e

KivaKit is a very Wicket-like way to do microservices, but you can consume just 
pieces of it easily. Everything you'd need to do messaging and logging is in 
the module  kivakit-kernel (although there are some additional loggers like 
EmailLogger in kivakit-extensions). Let me know if people are interested in 
trying this out on a branch and I'd be happy to help out.

Best,

   Jon


From: Martin Grigorov 
Sent: Wednesday, February 2, 2022 12:15 PM
To: users@wicket.apache.org 
Subject: Re: servlet api "BigBang"

Hi,

On Wed, Feb 2, 2022 at 4:59 PM Tobias Haupt  wrote:

> We are using wicket for several projects and are piece by piece
> migrating to wicket 9.
> In all of these projects we use logback as logging adapter. Since
> version 9.x wicket requires version 2.0.0.alpha[x] of slfj.
> Logback provides releases starting with version 1.3.0-alpha compatible
> with slfj 2.0.0.alpha. The Problem is that the new version is built
> against the "new" servlet-api 5.0 only. There all the javax. namespaces
> are renamed to jakarta. This makes logback unasable for a lot of
> applications that still run in older Containers (Tomcat 9 etc.). The
> people at logback are aware of that problem: see issue LOGBACK-1575.
>
> Question: is there a hard requirement to update the dependency of wicket
> to slfi to 2.0.0 especially as these releases are still tagged as alpha?
> Wouldn't it be better for wicket to stay at 1.x (eg. 1.7.35) as long as
> possible?
>

Wicket moved to 2.0.0-alpha because SLF4J 2.x is module-rized (JPMS) and
Wicket too since 9.5.0.
You can tell Maven to use 1.7.x in your application. The APIs are the same
so it should work.



>
> kind regards,
> Tobias
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.


Re: RedirectRequestHandler and HttpHeader?

2021-08-22 Thread Locke, Jonathan (Luo Shibo)
It's been a while, but can't you get the WebResponse from WebRequestCycle and 
then call response.setHeader()?

Jon


From: Korbinian Bachl 
Sent: Sunday, August 22, 2021 4:58 AM
To: users 
Subject: RedirectRequestHandler and HttpHeader?

Hi,

I call this:

getRequestCycle().scheduleRequestHandlerAfterCurrent(new 
RedirectRequestHandler("myNewURL",301));

How could I add a custom HttpHeader to the response?
e.g.: Cache-Control: max-age=300


Best,

KB

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.


Re: Possible bug / edge case found where page is not detached

2021-07-25 Thread Locke, Jonathan (Luo Shibo)
Now that is a stellar bug report.

From: Bas Gooren 
Sent: Sunday, July 25, 2021 12:06 AM
To: users@wicket.apache.org ; Sven Meier 

Subject: Re: Possible bug / edge case found where page is not detached

Hi Sven,

Done - https://issues.apache.org/jira/browse/WICKET-6908

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 24 juli 2021 bij 10:29:38, Sven Meier (s...@meiers.net) schreef:

Hi Bas,

that sounds like a bug.

Your quickstart didn't make it through the mailing list, would you please
attach it to a new Jira issue?

Thanks
Sven

Am 23. Juli 2021 19:30:46 MESZ schrieb Bas Gooren :
>Hi all,
>
>Today I spent the better part of my day investigating a bug report
>regarding a hibernate LazyInitializationException.
>Since we use detaching models everywhere and (in general) never see
>such
>issues anymore, this one was interesting :-)
>
>After much debugging I found out what is happening.
>
>We have a page which has a database model + links for prev/next item
>(in
>the database).
>When the users double-clicks on one of the links, the first click is
>OK,
>and the second click throws a StalePageException during request cycle
>processing.
>
>So far, normal.
>
>However, stepping through the wicket code, this is what happens:
>
>1) Resolve to ListenerRequestHandler, execute it, throws
>StalePageException
>2) exception mapper handles this and we execute a
>RenderPageRequestHandler,
>which re-renders the page
>3) the request cycle detaches, which delegates in part
>to RequestHandlerExecutor.detach()
>4) The handlers to detach are both handlers from step 1 and 2; During
>the
>detach of ListenerRequestHandler, it initializes ListenerLogData, which
>(in
>the PageLogData ctor) throws the StalePageException again!
>5) The second handler (RenderPageRequestHandler) is not detached, thus
>all
>models in the page are not detached
>6) The user clicks on a link and boom, the models are all still
>attached
>and there we get the LazyInitializationException
>
>I think that (a) RequestHandlerExecutor.detach() should ensure all
>handlers
>are detached, and (b) that failing to collect LogData should not stop
>the
>detaching of a request handler.
>
>What do you think?
>
>I tried to make the simplest possible Quickstart to demonstrate this.
>
>Weird stuff: on the homepage of the quick start, the page is properly
>detached when a stale link is clicked;
>On another (test) page, the page is not properly detached.
>
>Steps to reproduce:
>
>Run Quickstart
>Click on “Test” link on homepage
>Observe that the following is logged:
>
>Model still attached? false
>Page detaching
>
>Now click on "Click me (stale link)!”
>Now refresh the page (re-render)
>
>Observe that the following is logged:
>
>Model still attached? true
>Page detaching
>
>—> So the page was not detached
>
>These steps don’t have the same result on the homepage. So my guess is
>there is some relation to the fact that we are interacting with a
>stateful,
>non-mounted page.
>
>Met vriendelijke groet,
>Kind regards,
>
>Bas Gooren
[EXTERNAL EMAIL] CAUTION: This email originated from outside of Telenav. DO NOT 
CLICK links or attachments unless you recognize the sender and know the content 
is safe.


Re: Why aren't setEnabled and setVisible model based?

2021-05-10 Thread Locke, Jonathan (Luo Shibo)
Perhaps this is true, but now with lambda models, might it not be more useful 
to do this?

Jon

> On May 10, 2021, at 7:36 AM, Martin Terra  
> wrote:
> 
> You often need to know overall UI state to determine visibility, and you
> would end up with anonymous model classes of some sorts, so my educated
> guess is there is not much expected benefit, only caveats. One would expect
> a model to work and end up doing twice the work eventually using an
> anonymous class or overriding onConfigure.
> 
> **
> Martin
> 
> ma 10. toukok. 2021 klo 17.29 s...@stantastic.nl kirjoitti:
> 
>> So I finally took the plunge and joined the mailing list.
>> 
>> I have been using Wicket for well over a year now and am very happy to
>> have stumbled across it. There's just one question that I never really
>> found an answer to. I have searched the users list a couple of times and
>> found that some people are trying to use the 'setVisible' and
>> 'setEnabled' methods with a Model-argument. They want do this in order
>> to dynamically change visibility or access to a component. This idea has
>> also crossed my mind a couple of times.
>> 
>> The thing is... Wicket doesn't appear to work that way.
>> 
>> When I look at the answers, I see two approaches. One is overriding
>> 'isVisible', the other is to configure visibility from the 'onConfigure'
>> method in the parent component. I tend to use the later.
>> 
>> Because I always like to understand how things work, I would like to ask
>> about the reasoning behind this. Why can't 'setVisible' and 'setEnabled'
>> be controlled using IModel arguments? Is there a technical
>> limitation here? Or is it just a quirk?
>> 
>> Thanks.
>> 
>> Stan
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 9, Jetty and WebSockets

2020-08-09 Thread Locke, Jonathan (Luo Shibo)
Hi All,

I spent some time recently trying to upgrade a Wicket library we have to 
modular Java 11, Wicket 9, Jersey and latest Jetty + Jetty Web Sockets:


  jettyVersion = '9.4.31.v20200723'

 jerseyVersion = '2.31'

 wicketVersion = '9.0.0'


I had trouble with version conflicts between different REST API binaries that I 
wasn't able to resolve. I'd fix one conflict and it would cause another one. I 
don't suppose anyone has figured out how to get these to play together nicely?

 Jon