aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes DWR Security Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DWR Security Exception" Watch "DWR Security Exception" New topic
Author

DWR Security Exception

Arun Neelan
Greenhorn

Joined: Jul 13, 2007
Posts: 9
Hi all,
I migrated my project from Weblogic 8.1 to 9.2 and when i tried to invoke DWR method i am getting the below exception.

All the configuration 1. web.xml & 2. dwr.xml seem to be perfect.
The DWR class is also located at the correct path given in dwr.xml.
But still i am getting the below error.

java.lang.SecurityException: No class by name: MyDWRUtil
at uk.ltd.getahead.dwr.impl.DefaultCreatorManager.getCreator(DefaultCreatorManager.java:171)
at uk.ltd.getahead.dwr.impl.DefaultProcessor.doInterface(DefaultProcessor.java:418)
at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:84)
at uk.ltd.getahead.dwr.DWRServlet.doPost(DWRServlet.java:178)
at uk.ltd.getahead.dwr.DWRServlet.doGet(DWRServlet.java:165)
Truncated. see log file for complete stacktrace

Appreciate for any help.
[ September 12, 2007: Message edited by: Bear Bibeault ]
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Please share your web.xml and and dwr.xml files.

Also, which version of DWR are you using ?


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Arun Neelan
Greenhorn

Joined: Jul 13, 2007
Posts: 9
Hi Valentin,

dwr.xml
=======
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 0.4//EN" "http://www.getahead.ltd.uk/dwr/dwr.dtd">

<dwr>
<allow>
<create creator="new" javascript="MyDWRUtil">
<param name="class" value="com.samples.MyDWRUtil"/>
<include method="getDate"/>
</create>
</allow>
</dwr>


web.xml
=======

<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>


Version of dwr used is 1.2.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Can you make sure that com.samples.MyDWRUtil is present in the classpath?

And how does the HTML look like ?
Arun Neelan
Greenhorn

Joined: Jul 13, 2007
Posts: 9
Hi Valentin,
Normally in weblogic, we will give ....\WEB-INF\classes in the classpath.
But in our project (Weblogic 9.2) many other projects are being included and so we could not give ....\WEB-INF\classes in classpath.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Sorry, I don't get it... Are you deploying a WAR file or an EAR file? Or are you working in exploded mode in WL 9.2?
Arun Neelan
Greenhorn

Joined: Jul 13, 2007
Posts: 9
We are not deploying WAR or EAR, just trying to launch the screen from the exploded form in Weblogic 9.2.(Project uses multiple projects).
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
What is the projects layout? How do you built your code and set up the classpath?

I'm sorry I have a hard time figuring out how your project is organized.
Arun Neelan
Greenhorn

Joined: Jul 13, 2007
Posts: 9
When i run the server and give

http://localhost:7001/MyWebProject/dwr/index.html

it gives,
Classes known to URL
Other Links
Up to top level of web app. (Link)

I think Contextpath is not set proper.

because in weblogic 9.2 we keep our dwr.xml under MyWebProject/WebContent/....
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Is there any way I can try to access that URL remotely ?
 
 
subject: DWR Security Exception