Solved

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

Posted on 2013-06-18
2
657 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 58
endX challenge 2 50
stringclean challenge 26 58
thymeleaf natural templating vs JSP 2 30
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

10 Experts available now in Live!

Get 1:1 Help Now