Jump to content

Oracle MAF and IOException

Alright so I don't know how many people will be able to answer this but I'll give it a shot. 

So I am using Oracle MAF to play around with phone apps and stuff and I am using HTMLUnit as a library (headless browser).

When I use it in the code the IOException causes hiccups in the program.

I'm only trying to test stuff out right now and I don't really know why IOException is causing an issue. 

I've tested only initializing the browser and that works, but as soon as I execute any code with IOException I get errors. 

The code below is just my test to see if it will work in JDeveloper through an IOS simulator. So far it doesn't work in the simulation, but it does in Eclipse as a command line java program.

package mobile;

import oracle.adfmf.amx.event.ActionEvent;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.IOException;

public class hr {
    public hr() {
    }
  //on button click execute this code
public void doaction(ActionEvent actionEvent)throws IOException{
  		//initialize headless browser
        WebClient webClient = new WebClient();
        HtmlPage currentPage;
  		//get url
        currentPage = webClient.getPage("http://www.google.com/");
        String test = currentPage.getTitleText();
  		//print title of webpage
        System.out.println(test);                    
    }
}

The error that it is throwing is attached in an image. Also the command line error is below:

[SEVERE - oracle.adfmf.framework - Utility - invoke] InvocationTargetException Error: oracle.adfmf.framework.exception.AdfException

Let me know if you guys have any insight, it would be much appreciated.

Also, I know AdfException works, but I don't know how I could use it with HTMLUnit.

Thanks in advance.

Screen Shot 2017-11-06 at 8.18.00 PM.png

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×