Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Browser widget problem
Browser widget problem [message #1032312] Tue, 02 April 2013 21:17 Go to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
Hello
I have permanently problem with browser widget after operation setText.
I create one copy widget and after refresh only.
Dmitry



java.io.FileNotFoundException: .......\rwt-resources\org.eclipse.swt.browser\text612072251.html (The requested operation cannot be performed on a file with a user-mapped section open)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
Re: Browser widget problem [message #1032619 is a reply to message #1032312] Wed, 03 April 2013 08:04 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

Can you provide an example EntryPoint to reproduce the issue?

Greetings,
Tim


--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1035315 is a reply to message #1032619] Sat, 06 April 2013 17:43 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member

Composite grpBrowser = new Composite(grpMain, SWT.BORDER);
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
data.heightHint = 250;
grpBrowser.setLayoutData(data);

browser = new Browser(grpBrowser, SWT.BORDER);
browser.setText("Emty");

and when I select item from my table I use

String html = rs.getTObject(0).get("BIGREPORT");
browser.setText(html);


swt application with same code is working correctly
Re: Browser widget problem [message #1035327 is a reply to message #1035315] Sat, 06 April 2013 18:03 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
And
How can I clear rwt-resources\org.eclipse.swt.browser\?
Re: Browser widget problem [message #1036487 is a reply to message #1035315] Mon, 08 April 2013 12:46 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
> and when I select item from my table I use
> String html = rs.getTObject(0).get("BIGREPORT");
> browser.setText(html);
>

So what value is "html"?

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1036828 is a reply to message #1036487] Mon, 08 April 2013 21:49 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
html is just html-report from db.

On 08.04.2013 16:46, Tim Buschtöns wrote:
>
>> and when I select item from my table I use
>> String html = rs.getTObject(0).get("BIGREPORT");
>> browser.setText(html);
>>
>
> So what value is "html"?
>
Re: Browser widget problem [message #1037163 is a reply to message #1036828] Tue, 09 April 2013 08:28 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Dmitry,

the snippet below works for me. Maybe the problem is only reproducible
on a Windows filesystem? If you can reproduce the problem with a snippet
like this, then please open a bug.

Regards, Ralf


public class BrowserSnippet extends AbstractEntryPoint {

@Override
public void createContents( Composite parent ) {
parent.setLayout( new GridLayout() );
final Browser browser = new Browser( parent, SWT.BORDER );
browser.setText( "Empty" );
browser.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true
) );
Button button = new Button( parent, SWT.PUSH );
button.setText( "change content" );
button.addListener( SWT.Selection, new Listener() {
@Override
public void handleEvent( Event event ) {
browser.setText( "Some other text " + UUID.randomUUID() );
}
} );
}

}


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1037175 is a reply to message #1036828] Tue, 09 April 2013 08:40 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Sorry, but this is not enough information to reproduce the issue. I need
a complete EntryPoint, or better yet a complete Project that I can run
and reproduce the issue with. I used the few lines you gave me to create
an entry point (see below), but as expected this very simple application
behaves exactly that way it should. If the app crashes when you set the
"html" String, it is important to know exactly what state the
application is in at that moment and what the value of "html" is. I also
need to know which RAP version and which browser you are using.

public class BrowserCrash extends AbstractEntryPoint {

@Override
protected void createContents( Composite parent ) {
Composite grpBrowser = new Composite(parent, SWT.BORDER);
GridData data = new GridData(GridData.FILL_HORIZONTAL |
GridData.FILL_VERTICAL);
data.heightHint = 250;
grpBrowser.setLayoutData(data);
grpBrowser.setLayout( new FillLayout() );

Browser browser = new Browser(grpBrowser, SWT.BORDER);
browser.setText("Emty");
browser.setText( "A report??" );
}

}



Am 08.04.2013 23:49, schrieb Dmitry:
> html is just html-report from db.
>
> On 08.04.2013 16:46, Tim Buschtöns wrote:
>>
>>> and when I select item from my table I use
>>> String html = rs.getTObject(0).get("BIGREPORT");
>>> browser.setText(html);
>>>
>>
>> So what value is "html"?
>>
>

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1041982 is a reply to message #1037175] Mon, 15 April 2013 21:14 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
This is simple code with browser's problem.

First code works correctly.

run new ViewAlerts().show(parentGrp) again and upssss "The requested operation cannot be performed on a file with a user-mapped section open"


public class ViewAlerts {


	public ViewAlerts() {
	}

	protected Composite viewHistory(final Composite parentTab) {

	    Composite grpBrowser = new Composite(parentTab, SWT.BORDER);
	    GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
	    data.heightHint = 250;
	    grpBrowser.setLayoutData(data);
	    grpBrowser.setLayout( new FillLayout() );

	    Browser browser = new Browser(grpBrowser, SWT.BORDER);
	    browser.setText("Emty");
	    browser.setText( "A report??" ); 
	    return grpBrowser;
	}

	public void show(Composite parent) {
		TabFolder tabFolder = new TabFolder(parent, SWT.NONE);

		TabItem tabHistory = new TabItem(tabFolder, SWT.NONE);
		tabHistory.setText("History of alerts");
		tabHistory.setControl(viewHistory(tabFolder));
	}

}
Re: Browser widget problem [message #1042287 is a reply to message #1041982] Tue, 16 April 2013 08:16 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Dmitry,
the posted code works for me with RAP from master (2.1M1). Which RAP
version are you using? What is your OS, JDK (x64?)? Does it happen when
you start the application from IDE (Jetty) or you are deploying it to an
external servlet container as Tomcat?
Best,
Ivan

On 4/16/2013 12:14 AM, Dmitry Dukhov wrote:
> This is simple code with browser's problem.
>
> First code works correctly.
>
> run new ViewAlerts().show(parentGrp) again and upssss "The requested
> operation cannot be performed on a file with a user-mapped section open"
>
>
>
> public class ViewAlerts {
>
>
> public ViewAlerts() {
> }
>
> protected Composite viewHistory(final Composite parentTab) {
>
> Composite grpBrowser = new Composite(parentTab, SWT.BORDER);
> GridData data = new GridData(GridData.FILL_HORIZONTAL |
> GridData.FILL_VERTICAL);
> data.heightHint = 250;
> grpBrowser.setLayoutData(data);
> grpBrowser.setLayout( new FillLayout() );
>
> Browser browser = new Browser(grpBrowser, SWT.BORDER);
> browser.setText("Emty");
> browser.setText( "A report??" ); return grpBrowser;
> }
>
> public void show(Composite parent) {
> TabFolder tabFolder = new TabFolder(parent, SWT.NONE);
>
> TabItem tabHistory = new TabItem(tabFolder, SWT.NONE);
> tabHistory.setText("History of alerts");
> tabHistory.setControl(viewHistory(tabFolder));
> }
>
> }
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1042758 is a reply to message #1042287] Tue, 16 April 2013 20:58 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member

- use 2.1m1
- 32-bit Java.
- embedded Jetty


Re: Browser widget problem [message #1042996 is a reply to message #1042758] Wed, 17 April 2013 06:12 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Dmitry,
this is really an interesting problem. As no one from as can reproduce
it by the snippets posted by you, could you create a complete simple
project ready for import and start that demonstrate the issue.
Thanks,
Ivan

On 4/16/2013 11:58 PM, Dmitry Dukhov wrote:
>
> - use 2.1m1
> - 32-bit Java.
> - embedded Jetty
>
>
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Browser widget problem [message #1393134 is a reply to message #1042996] Thu, 03 July 2014 09:37 Go to previous message
Stefan Klaus is currently offline Stefan KlausFriend
Messages: 21
Registered: February 2011
Junior Member
Also it is a very old thread, i want to mention my solution:
I could reproduce the error with embedded jetty on windows.
Following reason:
Jetty buffers static content for webapps such as html files, css files, images etc and uses memory mapped files to do this if the NIO connectors are being used. The problem is that on Windows, memory mapping a file causes the file to be locked, so that the file cannot be updated or replaced. This means that effectively you have to stop Jetty in order to update a file
Solution:
webAppContext.setInitParameter(org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false"); 


and everything works fine.
Previous Topic:Difficulty Deploying RAP 2.0 (1.5 seems to be fine) Application using Tycho
Next Topic:File Upload Incubator Not Signed in RAP 2.0 compatible p2 repository
Goto Forum:
  


Current Time: Sat Apr 20 03:47:02 GMT 2024

Powered by FUDForum. Page generated in 0.04321 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top