Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Networking problem with BIRT generated resource URLs
abhiii
BIRT is generating resource URLs using the internal(to our network) name of the machine that is serving the request.
For example,
mymachine1.internaldomain:8080/reports/webcontent/birt/ajax/utility/BrowserUtility.js
Of course mymachine1.internaldomain has no meaning outside our network so the calls to load resources from outside our network fail.
Is there a way of setting the domain in config somehow? Then it would generate something like ...
mymachine1.usableexternaldomain:8080/reports/webcontent/birt/ajax/utility/BrowserUtility.js
Also, does the request need to be rerouted to the same machine?
We are using plain vanilla BIRT runtime on Tomcat.
Ubuntu 10.4
BIRT 2.6.1
Tomcat 6.0.29
This is our first BIRT deployment and we have discovered the issue very late so your help is really appreciated.
Find more posts tagged with
Comments
JasonW
The domain is not settable in BIRT. This seems more like a dns issue? The viewer is deployed relative. So if you have an external ip for the machine it should be something like
http://externalip:8080/reports
.
Jason
abhiii
Thanks for your quick response.
The reporting machines don't have an external name/IP. The requests are proxied to the internal server. The URL for the main reporting page with links to the individual reports is
http://mymainsite.com/reports
. The link is http:// mymainsite.com/reports/show/MyReport. This gets proxied to the right server and port 8080 for Tomcat with frameset?__report=report/MyReport.rptdesign. This serves the main page correctly but all the resource links are generated for the internal name of the machine which has no meaning outside the firewall so the report is broken. This is not a dns problem really and would work if we had control over the generated resource links.
Pity there is no quick configurable was to do what we want. I am wondering how other users have handled the issue. I suppose it occurs infrequently since most reporting is internal to a company rather than externally accessible.
JasonW
I know the framsetfragment.jsp page includes the js files relative.
<script src="birt/ajax/utility/BrowserUtility.js" type="text/javascript"></script>
I would have thought this would have come through the proxy. I am pretty sure there are others proxying the viewer.
Jason
abhiii
The issue is coming from the host name. Any idea how this is obtained? It does not seem to be from the servlet request as there seems to be no request.getRequestURL( ) in the source. I couldn't find any relevant references to InetAddress to acquire the hostname either.
JasonW
What are you using to proxy the app?
Jason
abhiii
Not exactly sure(sysads are away right now) but incoming requests are mapped either by the firewall or Apache.
JasonW
I did a quick test with apache 2 in proxy mode as described here:
http://tomcat.apache.org/tomcat-5.5-doc/proxy-howto.html
and if the connector element in tomcat is not configured correctly I get the same error as you. I changed the connector element and it worked fine. BTW the code below sets up the references. It is in the FramesetFragment.jsp. Specifically look how BASE href is generated.
<%
// base href can be defined in config file for deployment.
String baseHref = request.getScheme( ) + "://" + request.getServerName( ) + ":" + request.getServerPort( );
if( !attributeBean.isDesigner( ) )
{
String baseURL = ParameterAccessor.getBaseURL( );
if( baseURL != null )
baseHref = baseURL;
}
baseHref += request.getContextPath( ) + fragment.getJSPRootPath( );
%>
<%
Viewer root fragment
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/REC-html40/strict.dtd">
;
<HTML>
<HEAD>
<TITLE><%= attributeBean.getReportTitle( ) %></TITLE>
<BASE href="<%= baseHref %>" >
My connector looks like:
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8091"
proxyName="localhost"
proxyPort="80"/>
You need to change proxyName to your external site I believe.
Jason
abhiii
Thanks, that works! One outstanding mystery; in FramesetFragment.jsp, just before baseHref is declared there is a comment ...
"// base href can be defined in config file for deployment."
Is this just old cruft or can you really set baseHref in a config file?
Thanks again, saved my hide.
JasonW
Yes you can set it in the viewer.properties file:
base_url=yourbaseurl
The viewer.properites file is the default config file, but you can change it in the web.xml.
Jason