SyntaxHighlighter JS

2014-01-14

Apache ServiceMix intro

Apache ServiceMix (http://servicemix.apache.org/) is a great integration container that makes processing and transforming data from different sources easy. For example, if you need to constantly poll a directory for a CSV file and then process it into the database, Apache ServiceMix makes that process easy to create.

List of supported ServiceMix endpoints.

This is a quick cheat sheet on how to set-up and use Apache ServiceMix. The sample project will show how to use Apache ServiceMix.

Installation
1.) Download the default or full assembly at the ServiceMix download page.
2.) Uncompress it into any directory. The rest of the document will refer to this directory as /SERVICEMIX_DIR

      gunzip apache-servicemix.tar.gz
   tar xvf apache-servicemix.tar

Starting
1.) From a command prompt, go to directory /SERVICEMIX_DIR/bin

         cd /SERVICEMIX_DIR/bin
2.) Run command

         ./start

Deploying App
To deploy app, just copy the physical application into the directory /SERVICEMIX_DIR/deploy

That will automatically deploy the app.

Command Line Console
To connect to a local ServiceMix server with the command line console, use the command

cd /SERVICEMIX_BIN/bin
./client -a 8101 -h localhost -u smx -p smx


(These are the default settings for ServiceMix)

You will see a screen like


Web Console
The ServiceMix web console is not activated by default. To activate it for the first time, log into the command line console. Then from the ServiceMix console prompt, type the command

features:install webconsole

Then from a web browser, go to the URL http://localhost:8181/system/console

Stopping
To log out of the command line console without stopping ServiceMix, type in the command

shell:logout

To shutdown ServiceMix from the command line console, type in the command

osgi:shutdown now

ServiceMix can also be shut down from the operating system shell with the command

cd /SERVICEMIX_BIN
./stop

2014-01-12

How to add a new user/schema in Oracle

Question:
How do add a new user and schema in Oracle? (In Oracle, when you create a new user, you automatically create a new schema that has the same name as the username)

Answer:
Log in as a SYSTEM Oracle user and run the commands:

CREATE USER username
    IDENTIFIED BY password
    DEFAULT TABLESPACE user_tablespace
    QUOTA UNLIMITED ON user_tablespace
    TEMPORARY TABLESPACE temporary_tablespace;
 
GRANT CREATE SESSION TO username;
GRANT CREATE TABLE TO username;
GRANT CREATE VIEW TO username;
GRANT CREATE TRIGGER TO username;
GRANT CREATE PROCEDURE TO username;
GRANT CREATE SEQUENCE TO username;
GRANT CREATE SYNONYM TO username;
GRANT CREATE TYPE TO username;
GRANT UNLIMITED TABLESPACE TO username;

Oracle Doc on CREATE USER

You can find the default user_tablespace and temporary_tablespace via the SQL

SELECT *
FROM sys.database_properties
WHERE property_name like '%TABLESPACE%';


Question:
How do I delete a user?

Answer:

DROP USER username CASCADE;

2014-01-10

JEE Webapp Troubleshooting Tool

To help troubleshoot a web application, it is useful to print out information about the JEE server and the HTTP request.

I created a JSP page called serverinfo.jsp to display information about the server, Java memory, classpath, HTTP Session, and cookie.

I have used this tool numerous times in production to troubleshoot issues with load balancing, dropped sessions, bad cookies, and OutOfMemoryExceptions.

The source code is on GitHub .

View output of JSP page at http://jj-serverinfo.elasticbeanstalk.com/serverinfo.jsp