onApplicationStart() not firing

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=“application”,
type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get an
entry in the log file. I’m looking in the correct log and I can see other
log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?

i just did a testcase based on your input , i have the test make a little
bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change the
name (red) with every request and then i throw an exception (blue), because
writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in
that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

MichaOn Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz <@Phil_Cruz> wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=“application”,
type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get an
entry in the log file. I’m looking in the correct log and I can see other
log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

Hi Phil,

Can you please post your application.cfc here if possible? I have a suspicion…

GertSent from somewhere on the road

Am 10.08.2016 um 19:33 schrieb Phil Cruz <@Phil_Cruz>:

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now, I’m doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need to check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-Phil

On Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:
i just did a testcase based on your input , i have the test make a little bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change the name (red) with every request and then i throw an exception (blue), because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz ph...@philcruz.com wrote:
I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some errors where some application variables I was trying to reference where not being defined. I tracked it down and it seems that onApplicationStart() was not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=“application”, type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get an entry in the log file. I’m looking in the correct log and I can see other log statements written there.

If I hit a page that calls applicationStop(), then on the next request onApplicationStart() is called and I see the log entry. But why would it not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

FYI i have added a tstcase for the applcation.cfc start listeners
https://travis-ci.org/lucee/Lucee/builds/151311879

MichaOn Wed, Aug 10, 2016 at 7:46 PM, Michael Offner <@Michael_Offner> wrote:

I assume that the application context already exists and because of that
it is not fired. Have you more than one application.cfc file with the same
name inside your application?

There is one known difference to ACF when it comes to search the
application.cfc.
let say you have the following mappings

  • virtual: /susi/sorglos
  • physical: /Users/urs/mappings/sorglos

  • virtual: /susi/
  • physical: /Users/urs/mappings/susi

and the webroot is at:

  • physical: /Users/urs/webroot

When you now call /susi/sorglos/index.cfm in your browser. ACF will search
the application.cfc in the following order in the following locations:

  • /Users/urs/mappings/sorglos
  • /Users/urs/mappings
  • /Users/urs
  • /Users
  • /

so ACF simply goes up from the first location up to the root of the server.

Lucee on the other side will do this:

  • /Users/urs/mappings/sorglos
  • /Users/urs/mappings/susi
  • /Users/urs/webroot

So lucee follows the logic of the mappings.
This is the onl difference to ACF i’m aware of

Micha

On Wed, Aug 10, 2016 at 7:33 PM, Phil Cruz <@Phil_Cruz> wrote:

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now, I’m
doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need
to check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-Phil

On Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:

i just did a testcase based on your input , i have the test make a
little bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change
the name (red) with every request and then i throw an exception (blue),
because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in
that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz ph...@philcruz.com wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=
“application”, type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get
an entry in the log file. I’m looking in the correct log and I can see
other log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now, I’m
doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need to
check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-PhilOn Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:

i just did a testcase based on your input , i have the test make a little
bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change
the name (red) with every request and then i throw an exception (blue),
because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in
that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz <ph...@philcruz.com <javascript:>> wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=“application”,
type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get an
entry in the log file. I’m looking in the correct log and I can see other
log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead
of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

I assume that the application context already exists and because of that it
is not fired. Have you more than one application.cfc file with the same
name inside your application?

There is one known difference to ACF when it comes to search the
application.cfc.
let say you have the following mappings----------------------------------------------------

  • virtual: /susi/sorglos
  • physical: /Users/urs/mappings/sorglos

  • virtual: /susi/
  • physical: /Users/urs/mappings/susi

and the webroot is at:

  • physical: /Users/urs/webroot

When you now call /susi/sorglos/index.cfm in your browser. ACF will search
the application.cfc in the following order in the following locations:

  • /Users/urs/mappings/sorglos
  • /Users/urs/mappings
  • /Users/urs
  • /Users
  • /

so ACF simply goes up from the first location up to the root of the server.

Lucee on the other side will do this:

  • /Users/urs/mappings/sorglos
  • /Users/urs/mappings/susi
  • /Users/urs/webroot

So lucee follows the logic of the mappings.
This is the onl difference to ACF i’m aware of

Micha

On Wed, Aug 10, 2016 at 7:33 PM, Phil Cruz <@Phil_Cruz> wrote:

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now, I’m
doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need
to check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-Phil

On Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:

i just did a testcase based on your input , i have the test make a little
bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change
the name (red) with every request and then i throw an exception (blue),
because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in
that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz ph...@philcruz.com wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=“application”
, type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get
an entry in the log file. I’m looking in the correct log and I can see
other log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

https://luceeserver.atlassian.net/browse/LDEV-958

Thanks,
PhilOn Thursday, August 11, 2016 at 1:02:05 PM UTC-7, Micha wrote:

i will extend the testcase with this, can you raise a ticket here:
http://issues.lucee.org

Thx Micha

On Wed, Aug 10, 2016 at 11:29 PM, Phil Cruz <ph...@philcruz.com <javascript:>> wrote:

I found the issue! If this.ormenabled = true; the event does not fire. If
this.ormenabled =false it does fire. I stripped down my Application.cfc to
the bare minimum removing everything until I got the event to fire Here is
the code

component output=“false”{

this.name = “myapp”;
this.ormenabled = false;
this.ormsettings = {
datasource=“mydsn”,
cfclocation="/components",
eventHandling = true,
automanageSession = false,
flushatrequestend = false,
logsql = false,
dialect= “MicrosoftSQLServer”
};

public void function onRequest(required string TargetPage)
{
include arguments.targetPage;
return;
}

public boolean function onApplicationStart()
{
writeLog (text=“Application started…”, file=“application”, type=
“Debug”, application=“no”);

application.foo = “bar”;

return true;
}

}

Can you confirm that is a bug?

Thanks,
Phil

On Wednesday, August 10, 2016 at 1:01:59 PM UTC-7, Gert Franz wrote:

Hi Phil,

Can you please post your application.cfc here if possible? I have a
suspicion…

Gert

Sent from somewhere on the road

Am 10.08.2016 um 19:33 schrieb Phil Cruz ph...@philcruz.com:

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now,
I’m doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need
to check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-Phil

On Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:

i just did a testcase based on your input , i have the test make a
little bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change
the name (red) with every request and then i throw an exception (blue),
because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work
in that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz ph...@philcruz.com wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting
some errors where some application variables I was trying to reference
where not being defined. I tracked it down and it seems that
onApplicationStart() was not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=
“application”, type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get
an entry in the log file. I’m looking in the correct log and I can see
other log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit
https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit
https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead
of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/0467132d-4cec-42eb-a1d2-f9572712707a%40googlegroups.com
https://groups.google.com/d/msgid/lucee/0467132d-4cec-42eb-a1d2-f9572712707a%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

i will extend the testcase with this, can you raise a ticket here:
http://issues.lucee.org

Thx MichaOn Wed, Aug 10, 2016 at 11:29 PM, Phil Cruz <@Phil_Cruz> wrote:

I found the issue! If this.ormenabled = true; the event does not fire. If
this.ormenabled =false it does fire. I stripped down my Application.cfc to
the bare minimum removing everything until I got the event to fire Here is
the code

component output=“false”{

this.name = “myapp”;
this.ormenabled = false;
this.ormsettings = {
datasource=“mydsn”,
cfclocation="/components",
eventHandling = true,
automanageSession = false,
flushatrequestend = false,
logsql = false,
dialect= “MicrosoftSQLServer”
};

public void function onRequest(required string TargetPage)
{
include arguments.targetPage;
return;
}

public boolean function onApplicationStart()
{
writeLog (text=“Application started…”, file=“application”, type=“Debug”
, application=“no”);

application.foo = “bar”;

return true;
}

}

Can you confirm that is a bug?

Thanks,
Phil

On Wednesday, August 10, 2016 at 1:01:59 PM UTC-7, Gert Franz wrote:

Hi Phil,

Can you please post your application.cfc here if possible? I have a
suspicion…

Gert

Sent from somewhere on the road

Am 10.08.2016 um 19:33 schrieb Phil Cruz ph...@philcruz.com:

Yes, when I create a simple test app I get the expected behavior.

I’m only seeing this in my app that I’m converting from ACF. For now, I’m
doing this

public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need
to check if the application has been initialized
if (not isDefined(‘application.beanFactory’))
{
applicationStop();
return true;
}
}

which works but is not ideal of course.

Any ideas how I can debug/troubleshoot why it’s not firing?

-Phil

On Wednesday, August 10, 2016 at 10:26:51 AM UTC-7, Micha wrote:

i just did a testcase based on your input , i have the test make a
little bit clearer.
component {
this.name=createUUID();
public boolean function onApplicationStart() {
throw “start”;
return true;
}
}
to be sure i have a new application context with every request i change
the name (red) with every request and then i throw an exception (blue),
because writing to the log can have a delay (for performance reasons).
this works as expected for me.
to be honest it is unlikely that the onApplicationStart does not work in
that way, this would break every second application out there.
i will add a testcase that checks if onApplicationStart and
onApplicationStart get invoked correctly.

Micha

On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz ph...@philcruz.com wrote:

I’m migrating an app from ACF to Lucee 5 on Windows. I was hitting some
errors where some application variables I was trying to reference where not
being defined. I tracked it down and it seems that onApplicationStart() was
not firing. I simplified the function to

public boolean function onApplicationStart()
{
writeLog (text=“Application #this.name# started!!!”, file=
“application”, type=“Debug”, application=“no”);
return true;
}

When I restart the Lucee server and make the first request I don’t get
an entry in the log file. I’m looking in the correct log and I can see
other log statements written there.

If I hit a page that calls applicationStop(), then on the next request
onApplicationStart() is called and I see the log entry. But why would it
not be called on the very first request?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/0467132d-4cec-42eb-a1d2-f9572712707a%40googlegroups.com
https://groups.google.com/d/msgid/lucee/0467132d-4cec-42eb-a1d2-f9572712707a%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.