Sunday, December 22, 2013

JDev 11.1.2.4.0 - Android SDK set up page


Nothing special but the last one regarding Android Build Tool Location. The hint text is obviously miss leading. It has to be sdk/build-tools/android-4.4

Tuesday, December 3, 2013

Fastswap limitations

Fastswap is a weblogic server function to speed up development/deploy process. see WLS doc

However, some limitations has been reported by customers:
  • all fields modifiers are changed to ‘public’ when fastswap is enabled
  • CDI not working when fastswap is enabled
Checking internally, this seems to be a design decision and it cannot easily be ‘fxied’.
Enhancement requests have been raised but no progress yet.

Wednesday, November 27, 2013

First Markdown Blog

Write in markdown then publish to Blogger.com

just realized I can edit using statedit using markdown then publish to this blog.

Would recommend you to try it too at https://stackedit.io

Wednesday, November 6, 2013

JDeveloper 12c crashes at startup

I've recently started using JDeveloper, and will eventually start to support it.

However, the latest JDeveloper 12.1.2.0.0 gave me a headache, that I cannot start it. It always crashes on my Mint 15.

Below's the output:

$./jdev
Oracle JDeveloper 12c 12.1.2.0.0  Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 
# A fatal error has been detected by the Java Runtime Environment: #  SIGSEGV (0xb) at pc=0xa3e351e0, pid=16287, tid=2826627904 # JRE version: 7.0_15-b33 # Java VM: Java HotSpot(TM) Server VM (23.7-b01 mixed mode linux-x86 ) # Problematic frame: # C  0xa3e351e0 # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again [thread -1462166720 also had an error] # An error report file with more information is saved as: # [thread -1462166720 also had an error] # If you would like to submit a bug report, please visit: #   http://bugreport.sun.com/bugreport/crash.jsp /home/sean/Oracle/JDev121200/jdeveloper/jdev/bin/../../ide/bin/launcher.sh: line 603: 16287 Aborted                 (core dumped) ${JAVA} "${APP_VM_OPTS[@]}" ${APP_ENV_VARS} -classpath ${APP_CLASSPATH} ${APP_MAIN_CLASS} "${APP_APP_OPTS[@]}"

There's also a jdk mini dump generated, but almost useless(at lease to me).

I've tried the following:

  1. tried 32bit and 64bit, same problem 
  2. tried upgrading the default JDK 1.7.0_15 to the latest 1.7.0_45, no luck 
  3. tried JDeveloper 11g, no problem at all 


Checked internally and finally found the cause, it's an environment parameter that stops the IDE showing up:
GNOME_DESKTOP_SESSION_ID
On my Mint box, if I run:
 $env |grep GNOME 
 I got:
GNOME_KEYRING_CONTROL=/run/user/sean/keyring-X5wlWr
GNOME_KEYRING_PID=2272
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
XDG_CURRENT_DESKTOP=GNOME
It's this 'GNOME_DESKTOP_SESSION_ID=this-is-deprecated' causing the JDeveloper to crash. 

I modified my jdev under jdeveloper/jdev/bin, added one line after main section:

#-----------------------------------------------------------------------------
#  main
#-----------------------------------------------------------------------------
unset GNOME_DESKTOP_SESSION_ID

then JDev started like a charm.

Some people might have discovered another solution which was using 'sudo ./jdev' to start JDeveloper. I guess that has the same idea as that process has a different environment which does not contains this problematic 'GNOME_DESKTOP_SESSION_ID'.

Sunday, August 12, 2012

Spring logging is not working in JRF/SOA enabled domain

Recently got an interesting SR which worth sharing.

An application which uses Spring and uses log4j to log debug information. log4j.properties is configured for both application code and Spring code:
log4j.logger.com.company.customerCode=DEBUG
log4j.logger.org.springframework.core=DEBUG  
The logging works perfectly on a base weblogic domain, which both application and spring debug messages are printed to specified log file. However, when the application is deployed to a JRF/SOA enabled domain, we see only application debug messages, not Spring ones. Why??

When diagnosing this problem, 2 debug flags helped:

1) -Dlog4j.debug

we can see the sample output here:
log4j: Using URL [zip:D:/bea/WLS1036/user_projects/domains/TestDevDomain/servers/AdminServer/tmp/_WL_user/_appsdir_aif-sm_ear_1.0.0-dev-b57/mpc1b8/war/WEB-INF/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL zip:D:/bea/WLS1036/user_projects/domains/TestDevDomain/servers/AdminServer/tmp/_WL_user/_appsdir_aif-sm_ear_1.0.0-dev-b57/mpc1b8/war/WEB-INF/log4j.properties
log4j: Parsing for [root] with value=[WARN, logfile].
log4j: Level token is [WARN].
log4j: Category root set to WARN
log4j: Parsing appender named "logfile".
log4j: Parsing layout options for "logfile".
log4j: Setting property [conversionPattern] to [%x %d %p [%c] - %m%n].
log4j: End of parsing for "logfile".
log4j: Setting property [file] to [aif-common.log].
log4j: setFile called: aif-common.log, true
log4j: setFile ended
log4j: Parsed "logfile" options.
log4j: Parsing for [com.company.customerCode] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category com.company.customerCode set to DEBUG
log4j: Handling log4j.com.company.customerCode=[null]
log4j: Parsing for [org.springframework] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category org.springframework set to DEBUG
log4j: Handling log4j.additivity.org.springframework=[null]
log4j: Finished configuring.
the output tells us that log4j configuration is correct. the log4j properties files are loaded and configurations are set.

2) -Dorg.apache.commons.logging.diagnostics.dest=d:\test\jcl.log

this output tells us how JCL loads it's configurations.

Here's sample output snippet from a base domain:
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] Trying to get log class from attribute 'org.apache.commons.logging.Log'
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] Trying to get log class from attribute 'org.apache.commons.logging.log'
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] Trying to get log class from system property 'org.apache.commons.logging.Log'
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] Trying to get log class from system property 'org.apache.commons.logging.log'
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] No user-specified Log implementation; performing discovery using the standard supported logging implementations...
[LogFactoryImpl@15531576 from weblogic.utils.classloaders.ChangeAwareClassLoader@14877755] Attempting to instantiate 'org.apache.commons.logging.impl.Log4JLogger'
here's sample output sinippet from a JRF/SOA enabled domain:
[LogFactoryImpl@8199388 from weblogic.utils.classloaders.ChangeAwareClassLoader@1666116] Trying to get log class from attribute 'org.apache.commons.logging.Log'
[LogFactoryImpl@8199388 from weblogic.utils.classloaders.ChangeAwareClassLoader@1666116] Trying to get log class from attribute 'org.apache.commons.logging.log'
[LogFactoryImpl@8199388 from weblogic.utils.classloaders.ChangeAwareClassLoader@1666116] Trying to get log class from system property 'org.apache.commons.logging.Log'
[LogFactoryImpl@8199388 from weblogic.utils.classloaders.ChangeAwareClassLoader@1666116] Attempting to load user-specified log class 'org.apache.commons.logging.impl.Jdk14Logger'...
Seems there is a system property set for org.apache.commons.logging.Log

I checked JRF domain, it indeed has that:
org.apache.commons.logging.Log = org.apache.commons.logging.impl.Jdk14Logger 
it's configured in setDomainEnv.cmd:
set EXTRA_JAVA_PROPERTIES=-Dcommon.components.home=%COMMON_COMPONENTS_HOME% -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=%DOMAIN_HOME% -Djrockit.optfile=%COMMON_COMPONENTS_HOME%\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=%ORACLE_DOMAIN_CONFIG_DIR%\servers\%SERVER_NAME% -Doracle.domain.config.dir=%ORACLE_DOMAIN_CONFIG_DIR%  -Digf.arisidbeans.carmlloc=%ORACLE_DOMAIN_CONFIG_DIR%\carml  -Digf.arisidstack.home=%ORACLE_DOMAIN_CONFIG_DIR%\arisidprovider -Doracle.security.jps.config=%DOMAIN_HOME%\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=%DOMAIN_HOME%\servers\%SERVER_NAME%\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=%ALT_TYPES_DIR% -Djava.protocol.handler.pkgs=%PROTOCOL_HANDLERS%  %WLS_JDBC_REMOTE_ENABLED% %EXTRA_JAVA_PROPERTIES%
Then we found the problem. :)

There are 2 solutions for this problem:

1) modify the system level properties from
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
to
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
2) modify(or add one if not exist) the commons-logging.properties file under application's war file's WEB-INF\classes directory to contain the following content:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
priority=1

Wednesday, July 21, 2010

Make an web application as root application in WebLogic

A customer's asking how to make a war application the root application.

I believe this should be documented, but unfortunately I couldn't find that(maybe I've missed something...).

But anyway, the solution is quiet simple:

- create or modify weblogic.xml under war file's WEB-INF directory
- set context-root to be "/"

sample weblogic.xml:


<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<wls:context-root>/</wls:context-root>
</wls:weblogic-web-app>

Wednesday, November 11, 2009

Something posted long time ago on another blog site. Move it to here :)

Tips of using JSTL
June 1, 2004
Sometimes you will need to get an attribute from request or session. it's easy to use:

core:out value='${requestScope.attributeName}"

But, if the attribute's name is something like "aaa.bbb.ccc", you will have trouble. coz the JSTL will think you are trying to get a value ccc from object bbb from object ccc.

To dear with "." in such situation, use bracket, like this:

core:out value="${requestScope['aaa.bbb.ccc']}"

then it works, sweet, isn't it?