[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Internet Explorer giving Java error Instantiation Exception in frames only

Posted on 2009-04-23
7
Medium Priority
?
391 Views
Last Modified: 2013-12-08
Hello

I have a java application running on a JBOSS server, and a page on my website containing an iframe referencing this application.  

While viewing in IE7/8, I get the following error message:
java.lang.InstantiationException: org.aitools.programd.server.BotAccess

After clicking 'ok' and refreshing, the everything is fine.

Also, if you go straight to the application (not through the iframe on my website) no error comes up.


Neither Firefox or Opera have any problems.


I have read that this error is caused by lack of constructor, but I think it's more likely the file I'm using in the application is using depreciated values.
(I say this because I tried adding a constructor at the only point in the file where I thought it might have been lacking, and recompiling, but it gave errors.  When recompiling as-is, the file just gives warnings re depreciated somethings.)
I'm not familiar with Java though, so I'd rather leave the file alone (if it is indeed the problem) and find another way to get the error away, if possible!


Thanks in advance!
0
Comment
Question by:lucidica
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 24218561
could you provide source code for org.aitools.programd.server.BotAccess.java ?
0
 
LVL 3

Author Comment

by:lucidica
ID: 24218790
Here you go.

Thanks.
package org.aitools.programd.server;
 
import org.aitools.programd.Core;
 
/**
 * This is an object that provides an interface to a Program D bot to
 * be used from a server context such as a JSP page.
 * 
 * @author <a href="mailto:noel@aitools.org">Noel Bush</a>
 */
public class BotAccess
{
    protected Core core;
    
    protected String botid;
    
    protected String userid;
    
    /**
     * Creates a new <code>Bot</code> with the given
     * core, bot id and user id.
     * 
     * @param coreToUse
     * @param bot the id of the bot
     * @param user the id of the user
     */
    public BotAccess(Core coreToUse, String bot, String user)
    {
        this.core = coreToUse;
        this.botid = bot;
        this.userid = user;
    }
    
    /**
     * Returns a response to the given input, for the assigned
     * botid and userid.
     * 
     * @param input the user input
     * @return the response to the input
     */
    public String getResponse(String input)
    {
        return this.core.getResponse(input, this.userid, this.botid);
    }
    
    /**
     * @return the botid
     */
    public String getBotId()
    {
        return this.botid;
    }
    
    /**
     * @return the underlying bot object
     */
    public org.aitools.programd.bot.Bot getBot()
    {
        return this.core.getBot(this.botid);
    }
}

Open in new window

0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 24220377
It seems like somewhere in your application empty constructor is called.
first try to add empty constructor to your code to see that it is really this problem:
---
public BotAccess(){
}
------

If it is a case probably you need to tell how is your bean called from webapplication.
Do you use some webframework ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:lucidica
ID: 24220932
I can try testing with the empty constructor tomorrow, thanks for that.

I'm not sure how the bean is called though I'm afraid - does JBOSS handle that or is it the bean that specifies it?
<--- very low web application server know-how.

What I'm really puzzled on, though, is why it works if you're directly accessing it, but not if it's used through a frame/iframe, and then only in IE.
Perhaps a security issue?
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 1500 total points
ID: 24221870
it really depends how iframe is constructed in browser.
Could be something specific in IE
0
 
LVL 3

Author Comment

by:lucidica
ID: 25160622
Going to close this unsolved - unfortunately have no time to troubleshoot further.

Thanks to ramazanyich for his help!
0
 
LVL 3

Author Closing Comment

by:lucidica
ID: 31573915
Thanks for your help - apologies for not following this through to the end.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Suggested Courses
Course of the Month17 days, 15 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question