SecurityException, When making RCP Call to deployed Spring Webapp

411 views
Skip to first unread message

Gerhard

unread,
Dec 6, 2007, 4:06:57 AM12/6/07
to Google Web Toolkit
Hi,
I have upgraded from GWT1.3.3 to 1.4.60 yesterday... (to start using
Gwt-Ext in my app)
My Server side is a Hibernate/Spring setup. Persisting to a HSQLDB.

I have Created a GWTSpringController that sits in the Server, My
Client ServiceImpl is extending it.
I followed instruction that i found on the web - cant remember what/
where...

i copy'd the generated goodies from my www folder into my webapp
folder next to my WEB-INF folder.

I hooked up all the controllers in my remoting*-servlet.xml and
defined the beans that points to my GWTSpringController.
I Only have one servlet in my web context called remoting...
It worked like a charm while i was using 1.3.3, but i had to hack my
Service interface so that its Service entry points looks like this,
(it worked like this but im not too sure if stuffing around.)

target.setServiceEntryPoint("remoting/za.co.gpg.sheer.Sheer/
SheerPersistService");

Now im getting this when i click my login button:

java.lang.SecurityException: Blocked attempt to access interface
http://localhost:8085/webapp/za.co.gpg.sheer.Sheer/', which is either
not implemented by this servlet or which doesn't extend RemoteService;
this is either misconfiguration or a hack attempt
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
211)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
167)
at
za.co.gpg.sheer.mvc.GWTSpringController.handleRequest(GWTSpringController.java:
32)
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:
44)
...

What am i missing? Should i leave the setServiceEntryPoint() to just
point at my module? If so where and how should i deploy my gwt stuff
so that it will see my gwt spring controller?
I saw something on here about a generated *gwt.rcp file that should go
in my webapp? what is in this file and how do i generate it? -- if i
need it?

Any help will be appreciated.
Thanks
Gerhard

Eric Ponthiaux

unread,
Dec 6, 2007, 5:38:26 AM12/6/07
to Google-We...@googlegroups.com
Just read the error message ...

which is either
not implemented by this servlet or which doesn't extend RemoteService;
this is either misconfiguration or a hack attempt

Check your interfaces inheritance ...

Gerhard Goosen

unread,
Dec 6, 2007, 6:59:32 AM12/6/07
to Google-We...@googlegroups.com
This is my headers...

public class GWTSpringController extends RemoteServiceServlet implements
Controller, ServletContextAware

public interface SheerPersistService extends RemoteService

public class SheerPersistServiceImpl extends GWTSpringController implements
SheerPersistService

Miguel Méndez

unread,
Dec 6, 2007, 7:56:06 AM12/6/07
to Google-We...@googlegroups.com
This happens if you are using an older version of gwt-servlet.jar.  Check that you put the GWT 1.4 version on the server.

gerhard goosen

unread,
Dec 6, 2007, 10:06:32 AM12/6/07
to Google-We...@googlegroups.com
Hi thanks.
I'll check this as well.
But i found that 1.4.60 totally screwed with my GWT setup... when i
run the Shell it keep requesting a *nocache.js even after i switched
back to 1.3.3 (I had hoped that the change wouldn't affect my existing
stuff too much) ill have to try and switch later as my project
timeline doesnt allow me to waste more time on this.

Ill let you guys know if i run into trouble.
Thanks for all the responses
Gerhard

--

Regards
Gerhard Goosen

GWT Newbie

unread,
Dec 6, 2007, 11:55:36 PM12/6/07
to Google Web Toolkit
That's the point:

->I saw something on here about a generated *gwt.rcp file that should
go
->in my webapp? what is in this file and how do i generate it? -- if
ineed it?

After the GWT 1.4.59, a new concept "Serialization Policy" has been
introduced to the GWT development. The new compiler generates a rpc
white list file, as listed in the first post, to tell
RemoteServiceServlet which types are allowed to serialized.

RemoteServiceServlet will try to locate this file according to the
deploy path first. If found, objects assoicated with all remote
services within the module will be checked against on definations in
this file. If not, a legacy policy will be used for compatibility. In
other words, you have to make sure RemoteServiceServlet is able to
locate the while list file, which is automatically generated by the
GWT compiler.

In your case, it seems that the file was found and the type was not
listed in the white list file. A trick is to delete module.gwt.rpc
when deploying so that RemoteServiceServlet will use the lagecy
serialization policy. If it works, that could be diagnosed that the
problem is caused by the RPC serialization.

We got the same problem when trying to develop the server side and the
client side seperately. Is that your case too? It's really difficult
to diagnose what's going on without details. An omnipotent trick is to
trace the invoke process :)


gerhard goosen

unread,
Dec 7, 2007, 2:46:35 AM12/7/07
to Google-We...@googlegroups.com
yes i coded the backend first, to be accessible by many different
types of front -ends / flash / gwt / html/jsp...
i was thinking of serving up xml in a rss type feed to clients making
requests and persisting data using the same feed...
works great for flash and actionscript...
but then i started playing with gwt and HTTP.Async get and posts...
cuase i couldnt find any docs on spring integration... but i got it
going now....
somehow my maven build didn't pull the right gwt-servlet.jar into my
war file...

But i coded my guis like my ass (being lazy and using GWT Designer)
now it seems that 1.4.60 dont like RootPanel.get(); and calling
remove() on a absolute panel...

For the time being i just moved back to 1.3.3 / first want to complete
required functionality and fix my bugs.
Then ill do the upgrade.

--

Regards
Gerhard Goosen

Gerhard

unread,
Dec 10, 2007, 2:08:15 AM12/10/07
to Google Web Toolkit
Guys im not getting the rcp calls to work,
Like i said before i get this SecurityException... where it says im
trying to hack my own servlet or its a misconfiguration...

The Service Interface and Async Interface is in my GWT module client
package...
The implementation of my service sits in my GWT module server
package....

But my service extends a GWTSpringController that is in my SERVER,
totally separate compilied in java 5. The server was coded way before
i started looking at the frontend-tech.

My GWTSpringController extends RemoteServiceServlet and implements
Controller, ServletContextAware so that i can get hold of all my
SERVER side beans.


what i did to get the GWT module to load up was, i copied my
com.asdf.Module folder from the www folder after compile, into my
webapp SERVER module so that the structure is like this:
webapp
-WEB-INF
-com.asdf.Module
-index.html
- Module.html

the module.html i modified so that the
<meta name='gwt:module' content='com.asdf.Module'> looked like this
<meta name='gwt:module' content='com.asdf.Module=com.asdf.Module'>
// i found a link on the net that instructed this and it works under
gwt1.33
as well as this:
<script language="javascript" src="gwt.js"></script> to look like
this...
<script language="javascript" src="com.asdf.Module/gwt.js"></script>

All im trying to get this rcp todo is to take in 2 strings and do
login... it returns void ( i was doing this so that i could see if it
was serialization problems)

Is there anyone that has gotten GWT to make RCP calls to a SERVER that
is not GWT modules?
Its really starting to bug the crap out of me that i cant get this
working....

How do i Integrate the GWT side and my Spring Server side... as what i
have done abov for gwt1.33 feels like a hack.

Another Question my generated gwt.rcp file contains entrys on java
types (String,int,HashMap) and about 4 entries that are com.google
based classes .

Should my Service be listed in that file if it is to pass the
seriliazation policy?
Thanks guys

Miguel Méndez

unread,
Dec 10, 2007, 9:05:18 AM12/10/07
to Google-We...@googlegroups.com
No, your service interface does not need to appear in the policy file.  You need to make sure that you are using the right version of the Spring intergration.  I believe that they released a new version to comply with the GWT 1.4 changes.

> > ->I saw something on here about a generated * gwt.rcp file that should

Gerhard

unread,
Dec 10, 2007, 9:43:50 AM12/10/07
to Google Web Toolkit
really? ill have a look.

On Dec 10, 4:05 pm, "Miguel Méndez" <mmen...@google.com> wrote:
> No, your service interface does not need to appear in the policy file. You
> need to make sure that you are using the right version of the Spring
> intergration. I believe that they released a new version to comply with the
> GWT 1.4 changes.
>
> > > > ->I saw something on here about a generated *gwt.rcp file that should
> --
> Miguel

Miguel Méndez

unread,
Dec 10, 2007, 9:58:33 AM12/10/07
to Google-We...@googlegroups.com
I *thought* so, but I could be wrong.

Gerhard

unread,
Dec 10, 2007, 10:10:37 AM12/10/07
to Google Web Toolkit
I cannot see anything spesific to 1.4.60??? im really frustrated with
this... and im sure its a small thing...

On Dec 10, 4:58 pm, "Miguel Méndez" <mmen...@google.com> wrote:
> I *thought* so, but I could be wrong.
>
> --
> Miguel
Reply all
Reply to author
Forward
0 new messages