Solved

why do I received WARN messages when I ran code in htmlunit

Posted on 2013-06-18
2
666 Views
Last Modified: 2013-06-25
Hello I am new to HtmlUnit, I've install the latest htmlunit-2.12.jar and I want to run a couple of examples to start understanding it. When I run this code I get many WARN messages. Why do i get WARN messages? Is there a way to turn them off? Do i need to know about the WARN messages?

package com.att.temp;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.util.NameValuePair;

public class HtmlDelete {

	public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException {

		WebClient webClient = new WebClient();
		HtmlPage currentPage = 
			webClient.getPage("http://www.google.com/search?q=htmlunit");

		List<NameValuePair> headers = 
			currentPage.getWebResponse().getResponseHeaders();
		for (NameValuePair header : headers) {
			System.out.println(header.getName() + " = " + header.getValue());
		}
	}
	
	
 }

Open in new window


Output

WARN  (IncorrectnessListenerImpl.java:38 ) - Obsolete content type encountered: 'text/javascript'.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1419] Error in style rule. (Invalid token ":". Was expecting one of: <EOF>, <S>, <NUMBER>, "inherit", <IDENT>, <STRING>, <PLUS>, <COMMA>, <HASH>, <IMPORTANT_SYM>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <PERCENTAGE>, <DIMENSION>, <URI>, <FUNCTION>, "}", ";", "/", "-".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:1419] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2203] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2203] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2543] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2543] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:2616] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:2616] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3194] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3194] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3701] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3701] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:3761] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:3761] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:4196] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:4196] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:4960] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:4960] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:5610] Error in pseudo class or element. (Invalid token ":". Was expecting one of: <IDENT>, <FUNCTION_NOT>, <FUNCTION_LANG>, <FUNCTION>.)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:5610] Ignoring the whole rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6103] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6103] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6338] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6338] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6781] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6781] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:6938] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:6938] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7010] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7010] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7352] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7352] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:7872] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:7872] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:8755] Error in pseudo class or element. (Invalid token ":". Was expecting one of: <IDENT>, <FUNCTION_NOT>, <FUNCTION_LANG>, <FUNCTION>.)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:8755] Ignoring the whole rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9034] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9061] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:9061] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9690] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:9717] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:9717] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10292] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10319] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:10319] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10824] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:10851] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:10851] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11330] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11354] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:11354] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11841] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:11865] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:11865] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12748] Error in style rule. (Invalid token "*". Was expecting one of: <EOF>, <S>, <IDENT>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:12748] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12874] Error in expression. (Invalid token "color-stop(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:12963] Error in style rule. (Invalid token "left". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:12963] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13203] Error in expression. (Invalid token "from(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13243] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:13243] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13776] Error in expression. (Invalid token "color-stop(". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:13865] Error in style rule. (Invalid token "background". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:13865] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:828] Error in expression. (Invalid token "#4d90fe". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:845] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:845] Ignoring the following declarations in this rule.
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1340] Error in expression. (Invalid token "#4d90fe". Was expecting one of: <S>, <NUMBER>, <IDENT>, <STRING>, <PLUS>, <COMMA>, <URI>, "-", "=", ")".)
WARN  (DefaultCssErrorHandler.java:39 ) - CSS error: 'http://www.google.com/search?q=htmlunit' [1:1357] Error in style rule. (Invalid token "background-image". Was expecting one of: <EOF>, "}", ";".)
WARN  (DefaultCssErrorHandler.java:53 ) - CSS warning: 'http://www.google.com/search?q=htmlunit' [1:1357] Ignoring the following declarations in this rule.
Date = Tue, 18 Jun 2013 20:17:20 GMT
Expires = -1
Cache-Control = private, max-age=0
Content-Type = text/html; charset=UTF-8
Set-Cookie = PREF=ID=abb429facc153e67:FF=0:TM=1371586640:LM=1371586640:S=GH2sLni_ebVb4d4W; expires=Thu, 18-Jun-2015 20:17:20 GMT; path=/; domain=.google.com
Set-Cookie = NID=67=k3S90Te-jMt0uAkulEJs5Q1vnbIBTzwFReae45iBKJoGBV5-YtbIz5Jon4Nj8OYrtBJYu6ZlAf-imS3UOCSW-7VlqoeagCB4XiH9qi5bDvEPMXzbxIs9Q8MIyrQFa_RN; expires=Wed, 18-Dec-2013 20:17:20 GMT; path=/; domain=.google.com; HttpOnly
P3P = CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Content-Encoding = gzip
Server = gws
X-XSS-Protection = 1; mode=block
X-Frame-Options = SAMEORIGIN
Transfer-Encoding = chunked

Open in new window

0
Comment
Question by:yescobar2012
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 400 total points
ID: 39257916
I can't remember what kind of logging it uses, but you should probably turn up the logging to error level
0
 

Author Closing Comment

by:yescobar2012
ID: 39275068
did not answer my question
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now