Tuesday, June 15, 2010

Extract %time% in Batch Programming

Hi Friends,

Date & Time are two very sensitive information which we need to extract frequently which doing any batch scripting for administrative purpose.

While, i already covered a article regarding how to correctly extract %date%, lets focus on how to extract %time% ;-)

Well, for the record, %time% variable holds information uniformly across all Windows Version. Which is good as we can easily extract our information as per needs.

But wait, there is a catch! No matter what you do & instruct your regional settings to include a leading "0" (zero) before the hour, silly DOS will always fail to do so for time prior to 10:00 am!

So lets evaluate how to extract %time%:
A simple way is like below:
@set time_temp=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
@echo %time_temp%


This will work correctly only for time after 10:00 am as before 10:00 am, the %time% variable has value somewhat as:
C:\>echo %time%
C:\>7:06:03.64


As you can see, DOS fails to append a leading zero for your hour :-(
This makes my first approach fail instantly!

So how to go around & fix this problem?


As you can see, we simply but a check that if the extracted hour information is having the leading zero available or not...
If not, we are forcing one in the variable :-)

This should resolve your %time% extracting woes in batch programming!
If you have similar issues for extracting %date%, checkout how to extract %date%!

Keywords:
how to extract %time%, extract %time%, batch file commands, batch file command, bat files, bat file, batch files, batch script, batch scripting, batch program, windows scripting, windows scripts, DOS, %time%, Leading Zero, etc

Monday, June 14, 2010

Extract %date% in Batch Programming

Hi Friends,

One very annoying problems is extracting date & time using batch programming.
The reason is simple!
Try c:\>echo %date% on Windows 2003 Server v/s Windows 2000 Server
Windows 2000 Server Output: Sun 06/13/2010
Windows 2003 Server Output: 06/13/2010

You will see that both the output are different & that is a cause of big headache. When i write any administrative scripts for taking log backups with appropriate date, it is very important for me that such platform differences should not make my batch scripts to fail on either of the platform.

Thus, this let me out find a generic solution which will always extract correct date for me no matter its Windows 2000 Server or Window 2003 Server as the underlying platform!

My earlier way to extract date was like this:
@set date_temp=%date:~4,2%%date:~7,2%%date:~10,4%
This use to give me output as

Windows 2000 Server Output: 06132010
Windows 2003 Server Output: 3/01

As you can clearly see that my approach fails on Windows 2003 Server platform. I have the option to modify & setup my date extraction as per Windows 2003 Server platform, but that would make it fail on Windows 2000 Server :-(
So how to find that all in one code?

Well, its simple! Just have a glance at the below code:


Above code will always return you the correct date regardless of the underlying platform. It works correctly because its logic is based on the delimiter "-"
I was relieved that, atleast the delimiter is common across all the Windows Versions :-)

I hope this helps you in your batch or DOS programming :-D
If you have similar issues for extracting %time%, checkout how to extract %time%!

Keywords:
how to extract %date%, extract %date%, batch script, batch scripting, batch program, windows scripting, windows scripts, DOS, Windows 2000 Server, Windows 2003 Server, %date%, echo, etc

Thursday, June 10, 2010

oracle.apps.xdo.security.ValidateException

Hi Friends,

As promised in my first brush with BI Publisher post, the next error i faced was oracle.apps.xdo.security.ValidateException

Well, this was because the BI Publisher's security model was set to "BI Server" as BI Publisher was installed as part of OBIEE 10.1.3.4.1

Now, it is obvious that the RPD "Administrator" user password is changed from the default password "Administrator" & also the RPD must be missing the BI Publisher Security Groups with "Administrator" user added to XMLP_ADMIN group.

So before we proceed & understand the different Security Models & ways to counter the BI Publisher Authentication woes, it is must to setup a Super User in BI Publisher.

Super User is a fundamental used in BI Publisher which allows to have a one super admin regardless of whatever security model you configure. Due to this feature BI Publisher allows you to login & configure the BI Publisher system through one common super admin user.

In order to achieve this, you will first need to change the xmlp-server-config.xml file available under /xmlp/XMLP/Admin/Configuration/ folder:
Change the following line:
<property name="SECURITY_MODEL" value="BI Server"/>
TO
<property name="SECURITY_MODEL" value="XDO"/>

Setting the Security Model to XDO means, you are configuring the BI Publisher to use its builtin BI Publisher security model.

After you make this change, stop & restart your J2EE Application server.
Now try to access your BI Publisher using URL: http://host:port/xmlpserver/ & login using following details
User: Administrator
Password: Administrator

You should be inside BI Publisher now :-)!
Click the Admin Tab & under the "Security Center" section, click: Security Configuration


Inside "Local Superuser" section:
a) Enable the checkbox for "Enable Local Superuser
b) Choose a suitable "Superuser name"
c) Choose a suitable "Password"
d) Click the "Apply" button on the top right-hand corner.


e) Restart your J2EE App Server & try logging in using your Super user
If you can successfully login into the BI Publisher system, it makes way for you to start fidling with the other available Security Models for BI Publisher.

I will cover the other Security Models in upcoming posts.
Stay tuned!

Keywords:
BI Publisher, Tomcat, Apache, ResourceNotFoundException, OBIEE, 10.1.3.4.1, XML Publisher, Security Model, XDO, BI Server, SIEBEL etc

Tuesday, June 08, 2010

RESTful Webservices Support for Siebel

Hi Friends,

If you have heard about the REST (Representational State Transfer) Architecture, then you must have also heard about RESTful Webservices which formed on the principles of REST Architecture and gives us a more enhanced form of the Webservices in terms of scalability, interfacing with the systems & easy independent deployment of components.

Good news is Siebel 8.1.1 supports such RESTful Webservices!
It is available in Siebel 8.1.1.1 QF0135 & distributed generally as ACR 599

There are chances that this fix will be back ported for Siebel 8.0 Release as well :-)

If you need general guidelines regarding REST Architecture or RESTful Webservices, then below links are good starting points:
a) REST Architecture
b) RESTful Webservices
c) REST Tutorials

Keywords:
RESTful Webservices, REST Architecture, Siebel 8.1.1, Siebel 8.0, siebel crm,siebel customer relationship management,siebel solutions,siebel support,siebel supportweb,siebel systems,

Monday, June 07, 2010

oracle.apps.xdo.servlet.resources.ResourceNotFoundException

Hi Friends,

As promised in my first brush with BI Publisher post, the next error i faced was
oracle.apps.xdo.servlet.resources.ResourceNotFoundException "${oracle.home}/xdo/repository"

Well, i simply dont understand why does such nagging errors always come up.

Why does it happen?
The BI Publisher always need its Repository location to be defined in xmlp-server-config_orig.xml
Now had the BI Publisher being deployed on OC4J or OAS (Oracle Application Server), then the default path would have worked as a charm (${oracle.home}/xdo/repository)
But since we are deploying our BI Publisher in custom J2EE server, we will need to configure this path before we can actually use it.

Solution?
Its simple to rectify this. If you are using BI Publisher as part of integrated OBIEE Setup, you need to find the repository path.
Generally, the repository has folder structure as:
%OBIEE_INSTALL_ROOT%
-------xmlp
             -----------XMLP
                                  --------Admin
                                  --------DemoFiles
                                  --------Reports
                                  --------Tools

So your BI Publisher Repository path is: %OBIEE_INSTALL_ROOT%/xmlp/XMLP

Now you need to make these changes in the xmlp-server-config.xml file. This file is generally available in your WEB-INF folder where you have deployed the BI Publisher WAR in the J2EE Server.
E.g. for Tomcat: /tomcat-root/webapps/xmlpserver/WEB-INF/

Edit this file & change
<b><file path="${oracle.home}/xdo/repository"></file></b>
to
<b><file path="$OBIEE_INSTALL_ROOT/xmlp/XMLP"></file></b>

Now restart Apache Tomcat Server & you should be all set for a successful login into BI Publisher.


Keywords:
BI Publisher, Tomcat, Apache, ResourceNotFoundException, OBIEE, 10.1.3.4.1, XML Publisher etc

Friday, June 04, 2010

BI Publisher: com/phaos/crypto/CipherException

Hi Friends,

My first brush with BI Publisher... As always being the case, no Enterprise standard software easily setups as said in its documentation! Thats why the need to expert Consultants to deploy & maintain the same ;-)

Following was the brief error after i tried logging in from my BI Publisher login screen:

The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: com/phaos/crypto/CipherException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:100)

root cause

javax.servlet.ServletException: com/phaos/crypto/CipherException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.login_jsp._jspService(login_jsp.java:499)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:100)

root cause

java.lang.NoClassDefFoundError: com/phaos/crypto/CipherException
oracle.apps.xdo.servlet.security.SecurityHandler.getHandler(SecurityHandler.java:66)
org.apache.jsp.login_jsp._jspService(login_jsp.java:190)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:100)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs
.

Ahh....i was like what the heck!

Before i proceed again, i would like to quickly give you my BI Publisher Setup Info:
J2EE Server: Apache Tomcat 5.5.27
BI Publisher: 10.1.3.4.1
Standalone/Integrated: This was installed as part of OBIEE 10.1.3.4.1 Setup & not deployed as standalone.

Now, above error clearly points to some issue with the Authentication stuff we just passed in the login screen of BI Publisher. It is actually missing few important jars & libraries which are causing the issue.

Why did this happen?
Well, as you all know, OBIEE Installation in Basic form comes with OC4J while Advanced format requires Oracle Application Server. If you dont want either of this, you need to setup your own J2EE Server & deploy these applications from the given WAR files.

Now, the packaging of WAR files in case of BI Publisher has been different for OC4J & any generic J2EE server. You are bound to deploy the normal OC4J WAR file on Tomcat & then face this error.
The OC4J specific WAR files has few libraries missing as these are already available with base OC4J setup.

Solution?
Now, if you want to recover from this problem, you will first need to undeploy the earlier WAR file deployed on Tomcat.
Once you undeploy, restart your Tomcat and then deploy the WAR (xmlpserver.war) from "generic" folder.
Exact Location for the "generic" folder:
%OBIEE_SETUP_ROOT%/Platform/Solaris/Server_Ancillary/Oracle_Business_Intelligence_Publisher/generic
Platform stands for Solaris/Linux/Windows etc
Deploy the xmlpserver.war from this generic folder on your Tomcat.

Restart Tomcat & they open your BI Publisher:
http://host:port/xmlpserver/

Try logging in using your RPD Administrator user & password since BI Publisher coming with OBIEE uses OBIEE Security Model & not that of standalone BI Publisher.

If you face any of below errors post attempting to login in BI Publisher then stay tuned!! I will be documenting the solutions soon :-)


oracle.apps.xdo.servlet.resources.ResourceNotFoundException   
OR
oracle.apps.xdo.security.ValidateException

Till then happy debugging...

Keywords:

BI Publisher, OBIEE, xmlpserver.war, RPD, CipherException, 10.1.3.4.1, XML Publisher, Tomcat etc