Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: mod_jk - answers from appsrv often changes 'content-type ' from text/xml to t

Subject: mod_jk - answers from appsrv often changes 'content-type ' from text/xml to t

2007-11-02       - By MUDA(David Murko)

 Back

Dear all,

We have a strange problem with mod_jk on my linux box (centos45 -
64bit).
We use mod_jk 1.2.25 with apache 2.0.52 (default config) and on my
clients I got an error msg like this:

> System.InvalidOperationException:
> Client found response content type of 'text/plain; charset=UTF-8 (See http://UTF-8.ora-code.com)', but

> expected 'text/xml'

Our configuration is like this (all systems running Centos45 x86_64):
Webserver with mod_jk -> Appserver with jboss 4.2 -> DB server


Our clients are posting data to a soap service (axis) running on jboss
and expect an answer in text/xml like this:

####
Response: [
HTTP/1.1 200 OK
Date: Tue, 30 Oct 2007 10:54:59 GMT
Server:  Apache/2.0.52 (CentOS)
X-Powered-By: Servlet 2.4; JBoss-4 (See http://oss-4.ora-code.com).2.0.CR1 (build:
SVNTag=JBoss_4_2_0_CR1 date 0703051212)/Tomcat-5 (See http://cat-5.ora-code.com).5
Connection: close
Content-Type: text/xml;charset=UTF-8 (See http://UTF-8.ora-code.com)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body
/></soap:Envelope> ] ####

but we very often got back this (sometimes the first 3 times the answer
is text/xml and ok but then switches to text/plain ... so it switches
always and the only workaround with this config is to restart the
webserver and do it again)

####
Response: [
HTTP/1.1 200 OK
Date: Tue, 30 Oct 2007 16:44:55 GMT
Server: Apache/2.0.52 (CentOS)
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/plain; charset=UTF-8 (See http://UTF-8.ora-code.com)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body
/></soap:Envelope> ] #####

We tried also to test it on a windows box (and mod_jk 1.2.22) with the
same results:

#####
Response: [
HTTP/1.1 200 OK
Date: Tue, 30 Oct 2007 10:54:59 GMT
Server: Apache/2.2.4 (Win32) mod_jk/1.2.22
X-Powered-By: Servlet 2.4; JBoss-4 (See http://oss-4.ora-code.com).2.0.CR1 (build:
SVNTag=JBoss_4_2_0_CR1 date 0703051212)/Tomcat-5 (See http://cat-5.ora-code.com).5
Connection: close
Content-Type: text/xml;charset=UTF-8 (See http://UTF-8.ora-code.com)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body
/></soap:Envelope> ] ####

and switches to this response:

####
Response: [
HTTP/1.1 200 OK
Date: Tue, 30 Oct 2007 10:55:32 GMT
Server: Apache/2.2.4 (Win32) mod_jk/1.2.22
Connection: close
Content-Type: text/plain

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body
/></soap:Envelope> ] ####


Our client systems can only proper work with a response as 'content-type
text/xml'

The only solution we found to do is use mod_jk 1.2.19 - It also works
always when we go directly to jboss-tomcat port 8080 - We found also
this case description in the archive
http://www.mail-archive.com/dev@(protected)/msg20475.html .


Do anyone have a solution to use it with mod_jk 1.2.25 ?


Thx and greetz, david


A sample config from mod_jk is below:

mod-jk.conf
#####
# Jakarta Tomcat Connector #

# Load mod_jk module
# Specify the filename of the mod_jk lib
 LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
 JkWorkersFile conf/workers.properties

# Where to put jk logs
 JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
 JkLogLevel info

# Select the log format
 JkLogStampFormat  "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicates to send SSK KEY SIZE
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat
 JkRequestLogFormat "%w %V %T"

# Mount your applications
# JkMount /application/* loadbalancer

# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker # /examples/*=loadbalancer
 JkMountFile conf/uriworkermap.properties

# Add shared memory.
# This directive is present with 1.2.10 and # later versions of mod_jk,
and is needed for # for load balancing to work properly
 JkShmFile /var/cache/httpd/jk.shm

# Add jkstatus for managing runtime data
 <Location /jkstatus/>
      JkMount status
         Order deny,allow
         Deny from all
         Allow from 127.0.0.1
 </Location>

uriworkermap.properties
####
# Simple worker configuration file

# Mount the Servlet context to the ajp13 worker
/jmx-console=node1
/jmx-console/*=node1
/web-console=node1
/web-console/*=node1

/MCWeb=node1
/MCWeb/*=node1
/MC=node1
/MC/*=node1

workers.properties
####
# Define list of workers that will be used # for mapping requests
 worker.list=node1,status

# Define Node1
# modify the host as your host IP or DNS name.
 worker.node1.port?09 ## used for jboss ##
 worker.node1.host.16.45.12
 worker.node1.type=ajp13
 worker.node1.socket_timeout
 worker.node1.socket_keepalive?lse

# Status worker for managing load balancer
 worker.status.type=status










-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.