You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rush66 <jr...@gmail.com> on 2011/08/03 22:15:09 UTC

Re: CSS, JS resource file handle issues?

We setup a development environment in Ubuntu running the application and it
did not appear to have the same issue with editing resources with the app
server running. Changes were picked up from refreshing the browser.   

This issue makes  development a rather cumbersome process not being able to
edit CSS & JS with the app server running.

If anyone had any input or ideas it would be much appreciated.  

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3716725.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by Martin Grigorov <mg...@apache.org>.
This wont harm. Do it.

About the problem in this thread - please create a quickstart and
attach it to Jira.

On Mon, Aug 8, 2011 at 12:54 PM, Peter Ertl <pe...@gmx.org> wrote:
> Well, I _did_ follow the development ;-)
>
> Just made me wonder just from looking at 'open...' that there's no close.
>
> Maybe we need to do this:
>
>
>                // otherwise open the url and proceed
>                URLConnection connection = url.openConnection();
> // -----------------------
>                connection.setDoInput(false);
> // -----------------------
>
>                final long milliseconds;
>
>                try
>                {
>                        if (connection instanceof JarURLConnection)
>                        {
>                                JarURLConnection jarUrlConnection = (JarURLConnection)connection;
>                                URL jarFileUrl = jarUrlConnection.getJarFileURL();
>                                URLConnection jarFileConnection = jarFileUrl.openConnection();
> // -----------------------
>                                jarFileConnection.setDoInput(false);
> // -----------------------
>                                // get timestamp from JAR
>                                milliseconds = jarFileConnection.getLastModified();
>                        }
>                        else
>                        {
>                                // get timestamp from URL
>                                milliseconds = connection.getLastModified();
>                        }
>
>
>
> Am 08.08.2011 um 11:11 schrieb Martin Grigorov:
>
>> Please try to follow the development.
>> The first close was removed with
>> https://issues.apache.org/jira/browse/WICKET-3895 which will be
>> released with RC6, so this is not the problem here. In RC5.1 there
>> were two calls of close() and this caused some problems in WebLogic
>> container. Calling second close on
>> weblogic.utils.zip.SafeZipFileInputStream causes NPE.
>>
>> Maybe current trunk is not correct but here is how I see it: a
>> Connection is opened for the URL, then a check is made whether this
>> Connection is JarURLConnection and then #openConnection is called in
>> the jar's URL. At the end only the first connection is closed which
>> automatically should close the inner connection.
>>
>> If this is not correct then we need to close the inner (jar url's)
>> connection quietly. No need to dump exceptions while trying to close
>> the connections used only to get the last mtime.
>>
>> On Mon, Aug 8, 2011 at 11:56 AM, Peter Ertl <pe...@gmx.org> wrote:
>>> Well, there is no close statement for URLConnection!
>>>
>>> Just looking at a method named 'open' makes me automatically search for the equivalent 'close' statement.
>>>
>>> Am 07.08.2011 um 20:03 schrieb Peter Ertl:
>>>
>>>> in Connection#getLastModified(String url), line 69 there's an
>>>>
>>>>                               URLConnection jarFileConnection = jarFileUrl.openConnection();
>>>>
>>>> without a close() statement...
>>>>
>>>> could that be the reason?
>>>>
>>>> Am 06.08.2011 um 00:21 schrieb rush66:
>>>>
>>>>> As per your suggestion I grabbed the project from SVN and compiled the
>>>>> snapshot. Sadly there was no change in my results.  Is there a bug that is
>>>>> already filed for this?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
>>>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: CSS, JS resource file handle issues?

Posted by Peter Ertl <pe...@gmx.org>.
Well, I _did_ follow the development ;-)

Just made me wonder just from looking at 'open...' that there's no close.

Maybe we need to do this:


		// otherwise open the url and proceed
		URLConnection connection = url.openConnection();
// -----------------------
		connection.setDoInput(false);
// -----------------------

		final long milliseconds;

		try
		{
			if (connection instanceof JarURLConnection)
			{
				JarURLConnection jarUrlConnection = (JarURLConnection)connection;
				URL jarFileUrl = jarUrlConnection.getJarFileURL();
				URLConnection jarFileConnection = jarFileUrl.openConnection();
// -----------------------
				jarFileConnection.setDoInput(false);
// -----------------------
				// get timestamp from JAR
				milliseconds = jarFileConnection.getLastModified();
			}
			else
			{
				// get timestamp from URL
				milliseconds = connection.getLastModified();
			}



Am 08.08.2011 um 11:11 schrieb Martin Grigorov:

> Please try to follow the development.
> The first close was removed with
> https://issues.apache.org/jira/browse/WICKET-3895 which will be
> released with RC6, so this is not the problem here. In RC5.1 there
> were two calls of close() and this caused some problems in WebLogic
> container. Calling second close on
> weblogic.utils.zip.SafeZipFileInputStream causes NPE.
> 
> Maybe current trunk is not correct but here is how I see it: a
> Connection is opened for the URL, then a check is made whether this
> Connection is JarURLConnection and then #openConnection is called in
> the jar's URL. At the end only the first connection is closed which
> automatically should close the inner connection.
> 
> If this is not correct then we need to close the inner (jar url's)
> connection quietly. No need to dump exceptions while trying to close
> the connections used only to get the last mtime.
> 
> On Mon, Aug 8, 2011 at 11:56 AM, Peter Ertl <pe...@gmx.org> wrote:
>> Well, there is no close statement for URLConnection!
>> 
>> Just looking at a method named 'open' makes me automatically search for the equivalent 'close' statement.
>> 
>> Am 07.08.2011 um 20:03 schrieb Peter Ertl:
>> 
>>> in Connection#getLastModified(String url), line 69 there's an
>>> 
>>>                               URLConnection jarFileConnection = jarFileUrl.openConnection();
>>> 
>>> without a close() statement...
>>> 
>>> could that be the reason?
>>> 
>>> Am 06.08.2011 um 00:21 schrieb rush66:
>>> 
>>>> As per your suggestion I grabbed the project from SVN and compiled the
>>>> snapshot. Sadly there was no change in my results.  Is there a bug that is
>>>> already filed for this?
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
>>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: CSS, JS resource file handle issues?

Posted by Martin Grigorov <mg...@apache.org>.
Please try to follow the development.
The first close was removed with
https://issues.apache.org/jira/browse/WICKET-3895 which will be
released with RC6, so this is not the problem here. In RC5.1 there
were two calls of close() and this caused some problems in WebLogic
container. Calling second close on
weblogic.utils.zip.SafeZipFileInputStream causes NPE.

Maybe current trunk is not correct but here is how I see it: a
Connection is opened for the URL, then a check is made whether this
Connection is JarURLConnection and then #openConnection is called in
the jar's URL. At the end only the first connection is closed which
automatically should close the inner connection.

If this is not correct then we need to close the inner (jar url's)
connection quietly. No need to dump exceptions while trying to close
the connections used only to get the last mtime.

On Mon, Aug 8, 2011 at 11:56 AM, Peter Ertl <pe...@gmx.org> wrote:
> Well, there is no close statement for URLConnection!
>
> Just looking at a method named 'open' makes me automatically search for the equivalent 'close' statement.
>
> Am 07.08.2011 um 20:03 schrieb Peter Ertl:
>
>> in Connection#getLastModified(String url), line 69 there's an
>>
>>                               URLConnection jarFileConnection = jarFileUrl.openConnection();
>>
>> without a close() statement...
>>
>> could that be the reason?
>>
>> Am 06.08.2011 um 00:21 schrieb rush66:
>>
>>> As per your suggestion I grabbed the project from SVN and compiled the
>>> snapshot. Sadly there was no change in my results.  Is there a bug that is
>>> already filed for this?
>>>
>>>
>>>
>>> --
>>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: CSS, JS resource file handle issues?

Posted by Peter Ertl <pe...@gmx.org>.
Well, there is no close statement for URLConnection!

Just looking at a method named 'open' makes me automatically search for the equivalent 'close' statement.

Am 07.08.2011 um 20:03 schrieb Peter Ertl:

> in Connection#getLastModified(String url), line 69 there's an
> 
> 				URLConnection jarFileConnection = jarFileUrl.openConnection();
> 
> without a close() statement...
> 
> could that be the reason?
> 
> Am 06.08.2011 um 00:21 schrieb rush66:
> 
>> As per your suggestion I grabbed the project from SVN and compiled the
>> snapshot. Sadly there was no change in my results.  Is there a bug that is
>> already filed for this?   
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: CSS, JS resource file handle issues?

Posted by Peter Ertl <pe...@gmx.org>.
in Connection#getLastModified(String url), line 69 there's an

				URLConnection jarFileConnection = jarFileUrl.openConnection();

without a close() statement...

could that be the reason?

Am 06.08.2011 um 00:21 schrieb rush66:

> As per your suggestion I grabbed the project from SVN and compiled the
> snapshot. Sadly there was no change in my results.  Is there a bug that is
> already filed for this?   
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: CSS, JS resource file handle issues?

Posted by rush66 <jr...@gmail.com>.
As per your suggestion I grabbed the project from SVN and compiled the
snapshot. Sadly there was no change in my results.  Is there a bug that is
already filed for this?   



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by jcgarciam <jc...@gmail.com>.
Try compiling the SNAPSHOT from svn yourself and try again.

On Thu, Aug 4, 2011 at 7:23 PM, rush66 [via Apache Wicket] <
ml-node+3720006-321977728-65838@n4.nabble.com> wrote:

> The fix should've been in today's 1.5 snapshot correct? I moved our app to
> use the 1.5-SNAPSHOT that I got from a quickstart earlier today with the
> same issue.  It failed to reload the resource and logged
>  WARN  [UrlResourceStream] getLastModified for file:path  for each
> respective html file that was in use for the page I had open in the browser.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3720006.html
>  To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65838@n4.nabble.com
> To unsubscribe from Apache Wicket, click here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 

JC


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3720252.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by rush66 <jr...@gmail.com>.
The fix should've been in today's 1.5 snapshot correct? I moved our app to
use the 1.5-SNAPSHOT that I got from a quickstart earlier today with the
same issue.  It failed to reload the resource and logged 
 WARN  [UrlResourceStream] getLastModified for file:path  for each
respective html file that was in use for the page I had open in the browser.   

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3720006.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by Martin Grigorov <mg...@apache.org>.
There was a regression until recently. It is fixed in trunk.

On Thu, Aug 4, 2011 at 7:55 PM, rush66 <jr...@gmail.com> wrote:
> The only thing that has changed about or development environment would have
> been moving from wicket 1.4 to 1.5 so I am led to believe it is not Jboss.
> We have tried turning resource polling off and it doesn't seem to change
> anything.  We've stepped through the resource request cycle and can watch it
> open and close connections. So it is interesting that while the app server
> is running in windows  as soon as you save an open CSS or JS file eclipse
> will through an error.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3719277.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: CSS, JS resource file handle issues?

Posted by rush66 <jr...@gmail.com>.
The only thing that has changed about or development environment would have
been moving from wicket 1.4 to 1.5 so I am led to believe it is not Jboss. 
We have tried turning resource polling off and it doesn't seem to change
anything.  We've stepped through the resource request cycle and can watch it
open and close connections. So it is interesting that while the app server
is running in windows  as soon as you save an open CSS or JS file eclipse
will through an error.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3719277.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by Martin Grigorov <mg...@apache.org>.
I remember that newer versions of JBoss have some file system
abstraction (virtual fs or something like that). This caused similar
problems to other Wicket users. Check the mail archives.
Also try with another web container (e.g. Tomcat or Jetty) and see
whether the problem is still there.

On Thu, Aug 4, 2011 at 6:34 PM, rush66 <jr...@gmail.com> wrote:
> My apologies for the confusion. Development is cumbersome in windows with
> this issue having to restart jboss to pickup changes made to JS and CSS
> files.
>
> We are using Wicket 1.5RC5.1.  Changes to JS and CSS files are not picked up
> using eclipse running jboss locally in windows 7. Something from the javaw
> process seems to be leaving file handles to the resources open and due to
> the warning that shows up in the log about failed to get last modified time
> it makes me think it is something in the modification watcher.  Something
> about the file handle or lock prevents eclipse from coping it to the output
> directory.
>
> Concerning ubuntu we setup a dev environment running the same eclipse and
> jboss with the project. When changes to JS and CSS files are made with the
> app server is running it doesn't log the same warning. So refreshing the
> browser in ubuntu changes to resource files are picked up.
>
> I hope that can clarify the situation a little more.
>
> Thanks
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3719068.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: CSS, JS resource file handle issues?

Posted by rush66 <jr...@gmail.com>.
My apologies for the confusion. Development is cumbersome in windows with
this issue having to restart jboss to pickup changes made to JS and CSS
files.  

We are using Wicket 1.5RC5.1.  Changes to JS and CSS files are not picked up
using eclipse running jboss locally in windows 7. Something from the javaw
process seems to be leaving file handles to the resources open and due to
the warning that shows up in the log about failed to get last modified time
it makes me think it is something in the modification watcher.  Something
about the file handle or lock prevents eclipse from coping it to the output
directory. 

Concerning ubuntu we setup a dev environment running the same eclipse and
jboss with the project. When changes to JS and CSS files are made with the
app server is running it doesn't log the same warning. So refreshing the
browser in ubuntu changes to resource files are picked up.  

I hope that can clarify the situation a little more.  

Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3719068.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CSS, JS resource file handle issues?

Posted by Martin Grigorov <mg...@apache.org>.
I didn't get it. First you say it works as expected in DEV mode in
Ubuntu, then you claim it is cumbersome.
Which version of Wicket is in use and in what conditions it doesn't work ?

On Wed, Aug 3, 2011 at 11:15 PM, rush66 <jr...@gmail.com> wrote:
> We setup a development environment in Ubuntu running the application and it
> did not appear to have the same issue with editing resources with the app
> server running. Changes were picked up from refreshing the browser.
>
> This issue makes  development a rather cumbersome process not being able to
> edit CSS & JS with the app server running.
>
> If anyone had any input or ideas it would be much appreciated.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3716725.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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