Author Topic: Deploy webapp in cognos server  (Read 4691 times)

Offline Thanay

  • Senior Member
  • ****
  • Join Date: Nov 2013
  • Posts: 68
  • Forum Citizenship: +0/-1
Deploy webapp in cognos server
« on: 08 Jul 2015 12:33:59 pm »
Hi,

we developed one web application using spring mvc and cognos sdk to display list of reports, till now we tested this app in eclipse with apache tomcat server. but we need to deploy this app in cognos, because cognos itself having the websphere server by default. so how can i deploy this app.

and we configured cognos in iis server, what is the difference between iis and websphere.

Thanks.

Offline MFGF

  • Never knowingly correct
  • Super Moderator
  • Statesman
  • ******
  • Join Date: Jul 2005
  • Posts: 10,230
  • Forum Citizenship: +620/-10
  • Cognos Software Muppet
Re: Deploy webapp in cognos server
« Reply #1 on: 09 Jul 2015 02:38:40 am »
Hi,

we developed one web application using spring mvc and cognos sdk to display list of reports, till now we tested this app in eclipse with apache tomcat server. but we need to deploy this app in cognos, because cognos itself having the websphere server by default. so how can i deploy this app.

and we configured cognos in iis server, what is the difference between iis and websphere.

Thanks.

Hi,

Cognos comes with its own embedded application server. In versions before 10.2.2 this was Tomcat, but at 10.2.2 it changed to Websphere Liberty. However, it is not designed to host anything other than the Cognos processing, so you will struggle to deploy anything of your own into it. If you have the full Websphere Application Server software you can use this to host both Cognos and your own application - you deploy both into it. Instructions for deploying Cognos into other Application Servers are in the Installation and Configuration Guide.

IIS is a web server not an application server. A web server routes http requests to the Cognos gateway, whereas an application server hosts the two java servlet containers required to support content manager and application server processing within the Cognos architecture.

MF.
Meep!

Offline Thanay

  • Senior Member
  • ****
  • Join Date: Nov 2013
  • Posts: 68
  • Forum Citizenship: +0/-1
Re: Deploy webapp in cognos server
« Reply #2 on: 09 Jul 2015 05:52:43 am »
Hi MFGF,

Thanks for your reply.

we can't change the cognos from iis server to websphere, is there any alternates are there to deploy my web app in cognos sever.

Offline MFGF

  • Never knowingly correct
  • Super Moderator
  • Statesman
  • ******
  • Join Date: Jul 2005
  • Posts: 10,230
  • Forum Citizenship: +620/-10
  • Cognos Software Muppet
Re: Deploy webapp in cognos server
« Reply #3 on: 10 Jul 2015 03:26:04 am »
Hi MFGF,

Thanks for your reply.

we can't change the cognos from iis server to websphere, is there any alternates are there to deploy my web app in cognos sever.

Hi,

IIS is a web server not an application server. They are used for different things (see my previous post). If you are using a "vanilla" install of Cognos 10 your application server will either be Tomcat or it will be Websphere Liberty - Tomcat for 10.2.1 and all previous versions, Websphere Liberty for 10.2.2 and versions after this.

As far as I'm aware you cannot deploy other applications into Cognos's bundled application server (Tomcat or Websphere Liberty) as they are auto-provisioned and the tools to deploy into them are not included with the Cognos install. Your only other option is to use a different application server and deploy both Cognos and your application into this.

You stated in your original post that you have already deployed your application into Tomcat. Why not just leave it in Tomcat and have it sitting alongside the Cognos instance on the same server? Is there a specific reason you need your application to use the same application server as Cognos?

MF.
Meep!

Offline Thanay

  • Senior Member
  • ****
  • Join Date: Nov 2013
  • Posts: 68
  • Forum Citizenship: +0/-1
Re: Deploy webapp in cognos server
« Reply #4 on: 12 Jul 2015 04:13:11 am »
Hi,

my client doesn't want to maintain another server (Tomcat). because of this reason am looking for other alternatives.

Thanks.

Offline Thanay

  • Senior Member
  • ****
  • Join Date: Nov 2013
  • Posts: 68
  • Forum Citizenship: +0/-1
Re: Deploy webapp in cognos server
« Reply #5 on: 17 Jul 2015 01:28:44 am »
Hi,

i just created jsp pages and deployed in webapps folder in cognos installation. now it working fine.

Thanks

Offline bdbits

  • Super Moderator
  • Statesman
  • ******
  • Join Date: Feb 2010
  • Posts: 1,799
  • Forum Citizenship: +105/-0
Re: Deploy webapp in cognos server
« Reply #6 on: 17 Jul 2015 01:40:40 pm »
I'd be sure your client knows what you did to get it working there. They will likely have to redo it down the road when they update/upgrade Cognos.

Offline Andrew D Weiss

  • Community Leader
  • *****
  • Join Date: Jun 2008
  • Posts: 90
  • Forum Citizenship: +5/-0
    • Avnet BSP Software
Re: Deploy webapp in cognos server
« Reply #7 on: 23 Jul 2015 02:50:39 pm »
I would expect that a JSP page would work.  That's not a "deployment" in the sense that it's not a .war file that needs to be unpacked and set up as a web application.  We're struggling with this right now as well as we used to deploy some components into Tomcat to inspect performance information.  I'll circle back if we find a reliable way to deploy an application.  I'm not pleased with the auto-provisioned stripped down application server.  Especially when many IBM samples rely on using the webapps directory.

-Andy
MetaManager makes administering IBM Cognos a breeze.  http://www.bspsoftware.com/MetaManager

Offline Andrew D Weiss

  • Community Leader
  • *****
  • Join Date: Jun 2008
  • Posts: 90
  • Forum Citizenship: +5/-0
    • Avnet BSP Software
Re: Deploy webapp in cognos server
« Reply #8 on: 10 Oct 2016 10:28:17 am »
We recently found that you can deploy .war files into the wlpdropins folder in Cognos 10.2/Cognos11 using WebSphere Liberty Profile.

-Andy
MetaManager makes administering IBM Cognos a breeze.  http://www.bspsoftware.com/MetaManager

Offline eballinger75

  • Full Member
  • ***
  • Join Date: Aug 2016
  • Posts: 8
  • Forum Citizenship: +0/-0
Re: Deploy webapp in cognos server
« Reply #9 on: 13 Oct 2016 08:58:12 am »
Hi Andy,

Can you give some more information about the wlpdropins folder in Cognos 10.2?

We have several java servlets that we have been running from the Cognos (webapps) tomcat application server in Cognos 10.1.1. These are simple java serlvets to extend some of the functionality of Cognos. All that is required is to update the web.xml file and then put the class files in the classes folder. This has worked great except now when we are testing for our move to 10.2.2, we find that they have changed the app server to IBM Liberty and a few of the servlets do not work anymore.

When I test the servlets outside of Cognos they work fine (ie: in MyEclipse/separate app server), but putting them in Cognos gives a nasty error:

exception javax.servlet.ServletException: Servlet execution threw an exception

root cause java.lang.LinkageError: loading constraint violation: loader "org/apache/catalina/loader/WebappClassLoader@db286ee8" previously initiated loading for a different type with name "javax/xml/soap/SOAPMessage" defined by loader "com/cognos/pogo/isolation/ParanoidClassLoader@a804e8d4

I am not sure how to solve this yet. I have tried switching from the default IBM Liberty profile to Tomcat in Cognos Configuration but I get the same error.

I'll include the routine that its dying on just in case there is someone that might know whats happening:



private boolean checkExecutePermission (String reportsearchpath, String appName, String logLevel)
    {
       
        BaseClass bc[] = null;
       
        SearchPathMultipleObject spMulti = new SearchPathMultipleObject(reportsearchpath);
       
        logDebugToFile(logLevel, appName + " spMulti = " + spMulti.get_value() );
        try {
            bc = cmService.query(spMulti, new PropEnum[] {PropEnum.user, PropEnum.userName, PropEnum.permissions}, new Sort[] {}, new QueryOptions());
           
            for (int i = 0; i < bc.length; i++) {
                for (int a = 0; a < bc.getPermissions().getValue().length; a++) {
                    if (bc.getPermissions().getValue()[a].toString().contains("execute")) {
                        return true;
                    }
                }
            }
            } catch (Exception e) {
            e.printStackTrace();
       logErrorToFile(logLevel, appName + e.getMessage());
        } 
        return false;     
     }
 
Maybe the wlpdropins folder is what is need. Please tell me more about this.

Thanks
   

Offline eballinger75

  • Full Member
  • ***
  • Join Date: Aug 2016
  • Posts: 8
  • Forum Citizenship: +0/-0
Re: Deploy webapp in cognos server
« Reply #10 on: 19 Oct 2016 06:12:32 am »
Hi Guys,

I wanted to update this post since I found a workaround to this problem. If anyone else is using the embedded application server in 10.2.2 (WLP or Tomcat) you will need to make a change to web.xml found in [coginstalldir]/p2pd/WEB-INF and remove jaxrpc.jar from the section classLoaderExclude. This will allow your servlets to run without this new linkage error.

Cognos does not recommend using the embedded app server, but for simple java servlets we have been using this method for years with no issues without having to add the overhead of another app server to maintain.

Eddie

Offline pznevill

  • Associate
  • **
  • Join Date: Jan 2017
  • Posts: 1
  • Forum Citizenship: +0/-0
Re: Deploy webapp in cognos server
« Reply #11 on: 09 Jan 2017 04:36:04 pm »
Hey eballinger75,

I tried doing what you suggested, but with no success currently; Cognos stalls on restart. Could you give me a step by step of how you got this to work?

Thanks,

Philip

Offline eballinger75

  • Full Member
  • ***
  • Join Date: Aug 2016
  • Posts: 8
  • Forum Citizenship: +0/-0
Re: Deploy webapp in cognos server
« Reply #12 on: 20 Jan 2017 08:43:09 am »
Hello pznevill,

Are you trying to deploy a war file or servlet/jsps? If its a servlet then place the class file under [coginstalldir]/webapps/p2pd/WEB-INF/classes and then add a line to web.xml to reference the servlet.

        <servlet>
      <servlet-name>getPDF</servlet-name>
      <servlet-class>com.cognos.getPDF.getPDF</servlet-class>
   </servlet>
   <servlet-mapping>
      <servlet-name>getPDF</servlet-name>
      <url-pattern>/cognos/getPDF</url-pattern>
   </servlet-mapping>

Then you just reference the servlet like https://localhost:9400/p2pd/cognos/getPDF...

I also recently got a war file to deploy. If you place a war file into [coginstalldir]/webapps it will deploy itself automatically when you start Cognos. I switched the application server to Tomcat in 10.2.2 since it defaults to Websphere Liberty Profile by default. If you don't switch from the default then you should be able to use the wlpdropins folder like Andrew said.

One nice example I just got to work is for barcodes (example from IBM below). There is a barcode servlet out there at works great. Find the example here:

https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0ahUKEwj8ntfJ-dDRAhVH0YMKHaiiAMwQFghBMAM&url=https%3A%2F%2Fwww.ibm.com%2Fdeveloperworks%2Fcommunity%2Fforums%2Fajax%2Fdownload%2F77777777-0000-0000-0000-000014591060%2Feb0a22a6-a85a-4583-8047-2683eaf6cab3%2Fattachment_14591060_Print_Barcodes_in_Report_Studio.doc&usg=AFQjCNFOo9PsuqSfwI4rqAOFWP1s2tUWzQ&bvm=bv.144224172,d.amc

Also remember to remove the one jar I mentioned in this post.

Hope this helps.
Eddie



 


       
Twittear