Solved

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

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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL syntax check  without executing 6 100
Running JavaFX on JDeveloper 12C 1 76
servlet and mdb, jms error 1 54
Running JavaFX on the Raspberry Pi 27 120
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

685 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