Sunday, December 6, 2020

How to install Citrix Workspace App on ARM64 / raspberrypi 64bit / Ubuntu 20.10

 So, i've configured my raspberry pi 4 64bit/4GB RAM by installing Ubuntu Desktop 64bit (Groovy Gorilla)


Setup all my regular tools and when i tried to install Citric Workspace App, it failed.

First if all, Citrix Workspace App is only available for 32bit ARM (armhf) :(

Downloaded the citrix workspace app (Citrix Workspace app for Linux (ARM HF) from here https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html

AS i've installed 64bit ubuntu, enabled the 32bit architecture by running as sudo

sudo dpkg --add-architecture armhf

sudo apt update

Now tried installing the workspace app

sudo dpkg -i icaclient_20.10.0.6_armhf.deb (the one i downloaded, replace with appropriate version.)

 Got back the error

Errors were encountered while processing:
icaclient:armhf

 After searching/reading through forums, found this article. The gist is, 

edit the below file

sudo vim /var/lib/dpkg/info/icaclient.postinst

Look for below line in function UpdateMachineHWSuffix

echo $Arch|grep -i "^arm" >/dev/null

and replace with below

echo $Arch|grep -E "^arm|aarch64" >/dev/null

 Then just run the below command

 sudo dpkg --configure icaclient:armhf

 

Now, if you see any error with Entrust certificates, as per this article, execute the below

sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts/

Basically we are just asking citrix workspace app to reuse the existing certificates from firefox. 

 

That's all!

Monday, June 22, 2015

Configuring Oracle Driver on Jboss Wildfly 8.0

If looking for configuring oracle jdbc driver as an module for supporting XML data types, continue to read.

My initial setup was simple, an web application which uses oracle as backend with spring jdbc. I just deployed the oracle driver jar (ojdbc-6.jar) an a deployment using the jboss management console and used it to configure the datasource in standalone.xml. Everything was working fine till i used the XML datatypes as part of our design.

Immediately the fun started. Got the error NoClassDefFoundError: oracle/xdb/XMLType. After some research found that we need to include xdb-6.jar which can be found in the oracle client/server installations.
Added that the restarted the application, half expecting success!. Surprise!, got another error, related to xml parser exception. Turned out that i need to include another jar xmlparserv2.jar from oracle. This continued this for a while and found that creating the oracle driver as an module in wildfly or jboss as is the way to go.

Step 1: 

Create a folder as below under /modules/system/layers/base/com/oracle/main

Step 2:

Create the module configuration xml "module.xml" with below content<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.oracle">
    <resources>
        <resource-root path="ojdbc-6.jar"/>
        <resource-root path="xdb-6.jar"/>
        <resource-root path="xmlparserv2.jar" />
        <resource-root path="orai18n.jar" />
        <resource-root path="orai18n-collation.jar" />
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

Step 3:

Find and copy all the jars from your target oracle servers installation

ojdbc-6.jar
xdb-6.jar
orai18n.jar
orai18n-collation.jar
xmlparserv2.jar

Step 4:

Configuring the standalone.xml to load the driver module
Add the below snippet in section of your standalone.xml
        
</drivers>
....
        <driver name="oracle" module="com.oracle">
                <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> 
        </driver>
</drivers>

Step 5:

Referring the newly added driver in the datasource. You just need to refer the configured driver by name. Sample snippet below.


<datasource jta="true" jndi-name="java:/jdbc/MetricsDS" pool-name="MetricsDS" enabled="true" use-ccm="true">
            <connection-url>jdbc:oracle:thin:@10.158.20.50:1521:DEVDB1</connection-url>
            <driver>oracle</driver>
            <pool>
        ....
<datasource>

Step 6:

Remember to remove all existing ojdbc jars in your applications. This might cause inconvenience when you want to run your application in another container like tomcat due to the missing jar. But that's manageable by dropping the jar into the servers common lib folders.

Now start the wildfly/jboss server, and everything works just fine!

Friday, July 8, 2011

Configuring JBoss 6 Web Profile to run JNDI + EAR Deployment

I have searched the net and jboss community for finding any source on configuring jbossweb-standalone configuration to support JNDI. But was not able to find, so i have started to build one.

How to configure JBoss 6 Web Profile to enable EAR deployment and JNDI lookup. The app that i'm working on is a legacy app with everything in a single war, uses JNDI for datasource lookup. I have a task to re-design the app to be an EE app to support n-tier deployment for scalability.
I chose JBoss 6 for the dev environment in eclipse using the JBoss AS plugin along with WTP. With the default standard profile the startup and down times are around 6 to 7 mins on my laptop. Also i will not be using any EJB, JMS, JMX, WS etc services.
Attached a sample profile, modified version of Web profile, which would initialize JNDI and deploy EAR's as well.

Will update this blog with the changes that were done for achieving this. Hope this helps someone who might be looking for this configuration. Click here to download the configuration.
Once downloaded
  1. Extract the contents to a temporary folder.
  2. Rename the extracted folder from jbossweb-standalone to something else (ex: jbossweb-jndi-ear) This is for just preserving the existing jbossweb-standalong profile
  3. Copy the folder to /server folder
  4. Start the jboss server using the command /run.bat -c (Ex: /bin/run.bat -c jbossweb-jndi-ear)
Resources:
1. Configuration download

Sunday, June 27, 2010

Backing up SQL Server database files on to a samba shared network folder

Recently i encountered a sitution where we need to take a back up of existing sqlserver and restore it elsewhere. So i immeditely logged on to the server for checking the sie of the existing db files and my jaw dropped looking at the size! Its over 300 gigs. Yeah you guessed it right, the server is not having that much space for taking the backup. 


Immediately i tried for getting a new drive to the box and as usually it is going to take time. But i came to know that there is some 500 gigs of space available on a linux box which i can use temporarily. Great i immediately created a samba share on the linux box and tested the same on the production box for accessibility. Successfully accessed the share with the provided credentials, mapped the drive as z: drive on my server box. 
Started the sql server enterprise manger and open the backup dialog only to find that my Z: was not listed in there!! What's happening? The sad news is sql server does not support network folders as database storage folders. Great! now what to do...? ... That's exactly what i did, again went back to google with more queries. At last, i found that this can be achieved using some under documented features of sql-server. This is how we do it. 


Disclaimer ;) : Using a network folder for storing backups is not supported and there is a good chance of corrupted db files[From MSDN]. 


First of all, there are a set of trace flags which were present in sql server that we need to configure. I used only the flag 1807 for this purpose. 


DBCC TRACESTATUS 


Execute the above sql statement and you should get a results with three coulmns, with the status of configured trace flags on global, and session level's. 


Now, how to turn on that flag? 


DBCC TRACEON( 1807 ) to turn this on for session 


DBCC TRACEON( 1807 , -1) to turn this on globally. 


Once checked the status of the same using tracestatus command, i proceeded to take the backup. Still not working! My mapped network drive is not coming in the list, so i tried by typing in the path directly, that also didn't work. Then tried by giving the UNC folder path, even that also failed. 


Back to MSDN and i found out why, at the very end of the doc there is a suggesstion saying that the trace flags will work better if set as one of the startup parameter using -T option. Great, now i need to restart my db server twice. (but it seems that we need to configure this particular flag as startup param) 


After setting the startup param in the sql server configuratiom utility i restarted the server and issued the tracestatus command, and surprise the flag was set globally now! 


Okay i proceeded to do backup now and still my mapped drive is not showing up in the file browser!. Okay, i tried by directly typing in the UNC path. Still no luck! Arrrgg. What should i do? As per MSDN everything is setup and fine. 


After re-reviewing the whole setup the only thing that was looking odd is the shared folder itself. The share is on a linux box as a samba share (not a windows share), and it requires credentials! Wait a minute, though we already mapped the drive in explorer using credentials the sql server might not be using them. So went back to linux, made the share accessible to everyone (what? To everyone? That's ridiculous. I was going to copy a production db backup on to a drive accessible to everyone? Yeah, but what to do? No other quick option available now, so just made sure that the subnet is not being used by any one at that time by fiddling with the router firewall settings.) Now that's done, i have deleted the already mapped drive and re-mapped the same with out suppling the credentials. It worked. Immediately i tried the backup process and it worked!!!! Finally i was able to backup on to a linux shared folder using sql server. 


So in brief the steps are 


1. Set up a share with public access (Need to check if a windows share with credentials is having any issues)
2. Open the sql server config utility and add the startup parameter ;-T1807 
3. Restart the SQL Server 
4. Check the status of the flag using DBCC TRACESTATUS, it should show 1 for global. 
5. Do the backup by supplying the full UNC path in the destination folder. 
6. Open the sql server config utility and remove the trace flag parameter. 


Now that we have backedup the db on to share it is recommended to restore the backup from the shared folder and check for any corruption issues. 


Sql server does support a shared folder. But SQL Server supports provided that we install a SQL server certified storage driver which in-turn accesses the shared folder. Now obviously that will not come for free. 


Comments, opinions, suggesstions are welcome. 

Sunday, June 13, 2010

Better WTP dynamic project with FileSync

I have been working with eclipse WTP for quite some time for now. But all the time i have been working with small projects implementing some POC's etc. But recently i was confronted with the task of doing the same for a BIG project with some thousands of various types of resources including scripts, jsps, images, xmls, htmls, css and others. The source base is also having thousands of classes. After successfully configuring the WTP project for this new Big boy. As soon as i started the wtp server in eclipse, The Server immediately started the process of publishing the entire project to the deployment folder! It took good 5 minutes to copy the entire structure on my average desktop!.  Okay! i thought and once the server started i placed a set of break points and changed a single line of code and hit the save, in just 2 seconds or so again the process of publishing the entire project started!!! And after that my eclipse started dragging with the load of extra memory.

So the server is publishing the entire project structure with out simply publishing the resources that were changed! and that too everytime!! This is not fair! the WTP should be copying only the differentials rather than the entire project once we change any thing in the project. If this is a small project it might not have taken time at all, but being a Big project it is taking a lot of time :(

So we need to have a intelligent mechanism of copying only the differentials, stop the server from automatically publishing when ever there is a change to the project. And finally we need to manually sync the changes to the deployment folder and start the server for further debugging.

So i after googling around, i found the FileSync plugin which will do a sync of a given source folder in the project to a selected folder on the filesystem.

Finally here is my setup. Install the FileSync plugin first!!! Do everything i mean adding a new server runtime. Do not add the project now. Open the server runtime settings first and change a couple of settings. Set the option to "Never publish automatically." Next select the option to "Use custom location" and browse to a folder. The server will create the wtpwebapps folder underneath this folder. Next under server options select the options "Serve modules with out publishing". Once that's done, go to project properties and set the File Synchronization plugin properties setting the target folder as the new wtpwebapps\ folder and save.
From then on just a "Force File Sync" on the project before starting the project is doing for me.

If the WTP simply does a differential copy/sync i would not do all this stuff. Need to explore further if there is a way to fire the force file sync whenever we start the server :)