List of XQuery functions that are supported in OSB 11g
0A List of XQuery functions that are supported in OSB 11g, you can download here: list
and full details about all XQuery functions, you can find in these files:
OSB_HOME\eclipse130\plugins\com.bea.alsb.common.xquery.ui_1.3.0\xquery-ui.jar/strings\com\bea\wli\ide\xquery\ui\views\functions\BaseContext.decl
OSB_HOME\eclipse130\plugins\com.bea.alsb.common.xquery.ui_1.3.0\xquery-ui.jar/strings\com\bea\wli\ide\xquery\ui\views\functions\xquery-functions.xml
How to fix mapping errors in Hibernate(no dialect mapping for JDBC type: -9, Found: nclob, expected: nvarchar2)
1How to resolve these exceptions in Hibernate (with Oracle 11g Database – varchar2, nvarchar2, clob,…)?
MappingException: No Dialect mapping for JDBC type: -9
or
Wrong column type in MIG.LOG for column msg. Found: nclob, expected: nvarchar2(255 char)
These errors or problems you can fix, by using custom dialect, here is a sample code:
public class MyCustomeOracleDialect extends Oracle10gDialect
{
public MyCustomeOracleDialect()
{
registerHibernateType( Types.NVARCHAR, Hibernate.STRING.getName() );
registerColumnType( Types.VARCHAR, “nvarchar($1)” );
registerColumnType( Types.CLOB, “nclob” );
registerColumnType( Types.NCLOB, “nclob” );
}
}
Active Session in Weblogic, how to check in WLST?
0Here is a simple WLST script, that checks whether, session (pending changes) is activated in the WebLogic:
connect(‘<user>’,'<host>’,'<adminServer>’)
#config manager
cmgr = getConfigManager()
user = cmgr.getCurrentEditor()
#active session in weblogic for user
if user != None:
edit()
print ‘———–Active Session in WebLogic————-’
print ‘User: ‘ + str(user)
showChanges()#print all changes in active session
print ‘————————————————————–’while true:
action = raw_input(‘Do you want to activate the change? (y/n): ‘).strip()
if action in (‘y’,'YES’, ‘Y’):
try:
activate()
except Exception:
hideDumpStack(“true”)
break;
elif action in (‘n’,'NO’, ‘N’):
cmgr.undo()
cmgr.cancelEdit()
print ‘Changes was chanceled’
break;
How to create a service with EJB 3.0 (transport) in OSB 11g
0A simple manual to create a “Business Service” with using EJB 3.0 transport in OSB 11g.
- Open the Eclipse IDE (J2EE version), and click the menu “File-> New-> EJB Project“.
- Enter the name of the EJB 3.0 project “HelloOsbEjb” and select the checkbox “Add EAR project“,
click “Next“. In the next wizard page, select all the checkbox and click “Finish“.
- Create a new session bean “HelloOsbEjbBean“
with attribute mappedName will “helloOsbEjb” in project “HellOsbEjb“.
- Add new method to HelloOsbEjbBeanRemote and HelloOsbEjbBeanLocal session bean interface:
String helloMethod(String input);
- and implement it in “HelloOsbEjbBean“
public String helloMethod(String input) {
System.out.println(“Input: ” + input);
return “Hello EJB World in OSB 11g”;
}
- Select the project “HelloOsbEjb” and click “Run As-> Run on server” (project will be deployed on the server).
- Select the project “HelloOsbEjbEAR” and click “Export->EAR File“.
- Open the folder, when was the exported EAR file and unzip it (EAR contains EJB client jar file).
- Open the OSB console and deploy the EJB client jar (HelloOsbEjbClient.jar) to OSB as jar resource.
- OSB console go to the “System Management” and select “JNDI providers” and create a new JNDI provider
- The OSB console go to the section “Projects” and create a new project (if necessary) and create a new service “Bussiness Service” with name “HelloOsbEjbBusinessService” and type “Transport Typed Service“, click “Next”.
- Select protocol “EJB” and enter enpoint URI: ejb:myjndiprovider:helloOsbEjb#com.tomecode.osb.example.HelloOsbEjbBeanRemote , and click “Next“.
- In the page “EJB Transport Configugration” select checkbox “EJB 3.0” and select jar file in “Client Jar“, in “Business Interface” select “com.tomecode.osb.example.HelloOsbEjbBeanRemote“, click “Last” and “Save“.
- Now, you can launch test console for business service and execute test.
Highcharts integration with JBoss RichFaces (JSF/Facelets)
0If you want to integrate the Highcharts with JBoss RichFaces JSF/Facelets project, so some RichFaces components will not work.

The problem is Prototype and jQuery and other JavaScript frameworks, which are included in JBoss RichFaces.
To solve this problem, you need to make some minor changes in the Java Script for Highcharts, here they are.
- Load Highcharts script with component: <a4j:loadScript> (component allows to load scripts from alternative sources like a jar files, etc.), example:
<a4j:loadScript src=”../scripts/highcharts.js”/>
- In Highcharts script you need use jQuery.noConflict(); becuase many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias for jQuery, so all functionality is available without using $. And you need to use another JavaScript library alongside jQuery, you can return control of $ back to the other library with a call to $.noConflict(), example:
<script type="text/javascript">
jQuery.noConflict(); //fix all problems
jQuery(document).ready(function(){
....
....
//Highcharts config, properties, data....
....
....
});
</script>
Show me password (Extension for Oracle SQL Developer)
13The “Show me password“ is extension for Oracle SQL Developer i.e. simple utility that can display saved (decrypted) passwords, for all connections to databases.
Download:
What you need?
Oracle SQL Developer 2 or 3 and Java SE 1.6
How to install
Download extension and copy to SQL_DEVELOPER_HOME/sqldeveloper/extensions/ and run SQL Developer.
Note for Mac OS Version: copy extension to SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper
In the menu “File” you will see new menu item “Show Me Database Password”

If you click on menu item “Show Me Database Password”, then displays a window that contains one table with three columns: connection name, user name and decrypted password:

This project can also be found on Ohloh.net ![]()
How to transform XQuery to XML in Java
0I created a simple POC, how to transform XQuery into XML, here is example code:
// print XML to console
PrintStream ps = new PrintStream(System.out);
// sample xQuery
InputStream inputStream = Main.class.getResourceAsStream(“sample.xq”);
//xquery parser
XQueryToXQueryX xQueryToXQueryX = new XQueryToXQueryX();
// transform xQuery to XML
xQueryToXQueryX.transform(new XPath(inputStream).XPath2(), ps);
What you need…?
Download xquery parser from W3C, compile and create jar file and download POC example code.
Weblogic JMS Client – java.rmi.UnmarshalException: failed to unmarshal…
0Sometimes when I try to connect to Weblogic JMS, from my own JMS client (testing, development, etc.), I cannot connect because you receive this error:
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:
java.io.StreamCorruptedException: invalid type code: 31]
or
Caused by: java.io.StreamCorruptedException: invalid type code: 31
Fix for this error, I need to add the following VM arguments to the CLASSPATH:
-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
-Dsun.lang.ClassLoader.allowArraySyntax=true
Dumping the content or data from WebLogic Persistent Store (File Store)
14Last few days I spent a little ‘research’ on how it works in Oracle Weblogic File Store because I needed to get JMS messages (JMS Queue) from File Store when Oracle WebLogic Server was stopped.
I searched the internet for solutions or tools, but I found only WLST command, which dumping content from File Store.
Therefore, I developed a simple GUI (Java Swing) tool to export data from the WebLogic FileStore: Weblogic-FileStore-Explorer, for:
- export, HEX dump from FileStore (all data)
- export, only exists JMS messages for the selected JMS server – export data (JMS text messages) from FileStore in a readable format
- export, all JMS messages for the selected JMS server – export data (JMS text message) from FileStore in a readable format – but all JMS messages (i.e.- deleted, exists, etc.) and the result is the same as in option 2
Download source code…
Download app (version 1.3) …
Download Documentation …
Install for WebLogic 10g …
After downloading the tool, you must extract the zip file and copy these jar files:
../weblogic_install_dir/modules/com.bea.core.i18n_1.4.0.0.jar
../weblogic_install_dir/modules/com.bea.core.logging_1.4.0.0.jar
../weblogic_install_dir/modules/com.bea.core.store_1.4.0.0.jar
../weblogic_install_dir/modules/com.bea.core.utils.full_1.4.0.0.jar
../weblogic_install_dir/modules/com.bea.core.weblogic.workmanager_1.4.0.0.jar
../weblogic_install_dir/tools/eclipse_pkgs/2.0/pkgs/eclipse/plugins/
com.bea.workshop.upgrade81.thirdparty_1.0.100.200807251732/lib/wljmsclient.jar
to tool directory:
./weblogic-filestore-explorer/lib/
Install for WebLogic 11g …
../weblogic_install_dir/modules/com.bea.core.i18n_1.7.0.0.jar
../weblogic_install_dir/modules/com.bea.core.logging_1.7.0.0.jar
../weblogic_install_dir/modules/com.bea.core.store_1.6.0.0.jar
../weblogic_install_dir/modules/com.bea.core.utils.full_1.8.0.0.jar
../weblogic_install_dir/modules/com.bea.core.weblogic.workmanager_1.8.0.0.jar
../weblogic_install_dir/server/lib/wljmsclient.jar
to tool directory:
./weblogic-filestore-explorer/lib/
Requirements …
JAVA 1.6
Export Data from File Store…
- here is an example of how it looks the export data from the WebLogic File Store as a “Dump”:
- here is an example of how it looks the export data from the WebLogic File Store, after formatting to its original state with tool – WebLogic FileStore Explorer:
Note: Please, if you will find any bugs please send me. Then I will try to fix it and incorporate to the new version as soon as possible. Thanks.
