As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Hello all, I'm trying to use the ReportCaster API to create some customized report scheduling in WebFOCUS. I have some Java code here most I pulled from the documentation
CasterManagedConnectionFactory managedConnectionFactory = new CasterManagedConnectionFactory(); managedConnectionFactory.setServerName(server);//the name of the server running the distribution server managedConnectionFactory.setPortNumber(port_num);//the port the distribution server is listening
ConnectionSpec credential = new PasswordCredential(execId,execPassword.toCharArray());
CasterConnection aa = (CasterConnection)connectionFactory.getConnection(credential); System.out.println("Hello"); throw new ResourceException(); /*
ConnectionSpec credential = new PasswordCredential(execId, execPassword.toCharArray()); //This can be any of the credential objects. It is assumed here the user String has been assigned earlier // and that password, also assigned earlier, is a String that needs to be converted to a character Array.
I can get you part of the way there. Use the listening port of the RC server (typically 8200). I pulled out some old code to test, but I still cannot get a proper connection to initialize. I will try to look into this tomorrow.This message has been edited. Last edited by: dhagen,
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Are you able to schedule a report and run directly using reportcaster and the same user and password that you are using in the java code. We working doing exactly the samething as you and i can tell that we run into these issue many times. I would check this first.
Regards.
WebFocus 7.6.5 AND WebLogic server as web server sql2005 as database server
Posts: 273 | Location: Europe | Registered: May 31, 2007
Hi, yes, I can access RC directly and use the same user id and password and run the schedules ok, just keep getting that "invalid stream header" error when trying to connect via Java. Majid jedddi - were you able to get around it, when you say you've run into the issue many times?
dhagen - I did try using a different port and I just get a "connection refused" message.
Is there perhaps some setting for access that needs to be configured on RC server? I would think that whatever mechanism connecting to RC directly uses would be the same through custom Java code? In any event, I unfortunately don't have direct access to manipulate the RC server, as it is managed by a different group that keeps a pretty tight lid around it. Thanks for any insights you can provide.
Hi - yea, I have all the IBI API jar files that have referenced classes in my class path. Just to clarify, the error I'm getting is at run-time and not compile time.
Yes ... re-read my earlier post. You're source code works fine so long as you use the port of the report caster server!
If you are getting an error message still, then you may not have all of the required JARs on your classpath. IF you are still getting an error message, than post the complete message along with your classpath.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Hmmm, here's what I have in my class path variable:
c:\j2sdk1.4.2_19\*.jar;d:\ibi\devstudio76\webapps\webfocus76\web-inf\lib\*.jar;c:\java\reportcaster.jar;c:\ibi;c:\java;D:\Documents and Settings\moabrin\My Documents\JCreator Pro\MyProjects\ReportCaster\classes;D:\documents and settings\moabrin\Application Data\Sun\Java\Deployment\cache\javapi\v1.0\jar\*.jar;d:\ibi\DevStudio76\Webapps\webfocus76\WEB-INF\lib\connector-api.jar
Wouldn't I be getting compile error if I was missing a path to a referenced class? This error is occurring at run-time.
Yea, I'm certain the RC server name is correct. I even tried its IP address. Port number is the only one I'm uncertain on, though I believe it's 80, as that is the one that is used when accessing RC directly over the Web. With port 80, I get the error:
javax.resource.ResourceException: Configuration and Initialization Error: Received an IOException. invalid stream header
Any other port I get, "javax.resource.ResourceException: Configuration and Initialization Error: Received an IOException. Connection refused: connect"
Can you please do me a favour? Please ask you administrator to go to the server running reportcaster and ask him to do the following:
From windows : launch add/remove programs then add windows component and then add the print services for unix. Once that is done re-start the server and re-try.
I am curious to see what will happen. Regards
WebFocus 7.6.5 AND WebLogic server as web server sql2005 as database server
Posts: 273 | Location: Europe | Registered: May 31, 2007
ok, one thing I found, I don't have the webfocus_caster.jar. Is that supposed to be a part of the standard WebFOCUS install? Unfortunately, I can't request the server rebooted. It's a completely separate group that supports several users across our company and so wouldn't accommodate me in that fashion.
If you have these services installed. Would it be possible to stop them and see if that code is still working. If you are getting the same error than Mike in this case that would be the reason.
Is that possible?
Regards.
WebFocus 7.6.5 AND WebLogic server as web server sql2005 as database server
Posts: 273 | Location: Europe | Registered: May 31, 2007
Mike: webfocus_caster.jar is not a required jar. I removed it and tested.
Majid: I'm not sure why, but I did as you asked. With the RC Service stopped, the process fails with an "Unable to communicate" error. If however, I set the connection port to 80 (IIS), then it will fail (obviously) with the same error as reported by Mike (header stream).
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Originally posted by Mike Bank: Yea, I'm certain the RC server name is correct. I even tried its IP address. Port number is the only one I'm uncertain on, though I believe it's 80, as that is the one that is used when accessing RC directly over the Web. With port 80, I get the error:
javax.resource.ResourceException: Configuration and Initialization Error: Received an IOException. invalid stream header
Any other port I get, "javax.resource.ResourceException: Configuration and Initialization Error: Received an IOException. Connection refused: connect"
(Including port 8200).
Its most likely not port 80. Port 80 is an HTTP port and it would be extremely unlikely to have your Distribution Server running on the same port as HTTP.
The proper port to use here can be found in: rcaster76\WEB-INF\web.xml
As the value of AGENT_PORT. This same number is also in the ReportCaster configuration and in \ReportCaster76\bin\classpath.bat under "DSPORT".
Once you have this, go to your commmand prompt and type in the following with RCHOST being your hostname and RCPORT being the port you're trying to use:
telnet RCHOST RCPORT
If ReportCaster is listening on that port and there is not a firewall, etc, blocking access, you will see something like this:
¼φ
If you receive the message: "Could not open connection to the host, on port RCPORT: Connect failed"
or any other message where it does not connect then you have the port wrong, or a firewall is blocking access.
Originally posted by Majid Jeddi: There is a windows service running on that server called:TCP/IP Print Server. Just stop it run the java code and see if that is still working.
This service does not exist in my environment.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Even if it is not recommended and to be fixed about this issue i would first: 1/Disable the firewall on the network connection 2/ also consider disable the Antivirus if there is one.
Then retry.
Regards.
WebFocus 7.6.5 AND WebLogic server as web server sql2005 as database server
Posts: 273 | Location: Europe | Registered: May 31, 2007