Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven project error 5 54
oracle 11g 23 74
java jdbc batch example 8 32
Unhandled exception type Exception 18 28
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

786 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