Donnerstag, 10. Oktober 2013

Proximity sensor on IPhone 5 and IOS7 not working

Since the update to IOS7 on my IPhone 5 I sometimes switched the speaker on during a running phone call with my ears. To avoid this you should do the follwing after update your device to IOS 7:

  1. Go to Settings->General->Reset->Reset All Settings
  2. Reboot your device

thats it. A simple test can be done by calling your voice mail an during the call just put your finger on the sensor (it's located  left beside the camera on IPhone5). The sensor will turn of the display once you finger approaches the sensor.

Dienstag, 8. Oktober 2013

HP-UX WebLogic and a Jaxb2Marshaller startup failed with ArrayIndexOutOfBoundsException

I ran in to a problem on a weblogic 10.3.5 instance where we installed an ear file with a new springframework ws application. This application uses a Jaxb2Marshaller for handling the ws messages in a spring config like this:


    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"
          p:contextPath="com.mycomp.ws..client.model" />
    <bean id="sampleWsTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
    <constructor-arg ref="messageFactory"/>
    <property name="marshaller"      ref="marshaller" />
    <property name="unmarshaller"   ref="marshaller" />
    </bean>

the weblogic container failed to start up the application with the follwing messages:

org.springframework.web.context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.ws.client.core.WebServiceTemplate net.kambrium.service.impl.ServiceImpl.webServiceTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'WsTemplate' defined in class path resource [webservices.xml]: Cannot resolve reference to bean 'marshaller' while setting bean property 'marshaller'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [webservices.xml]: Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.ws.client.core.WebServiceTemplate net.kambrium.service.impl.ServiceImpl.webServiceTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'WsTemplate' defined in class path resource [webservices.xml]: Cannot resolve reference to bean 'marshaller' while setting bean property 'marshaller'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [webservices.xml]: Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'WsTemplate' defined in class path resource [webservices.xml]: Cannot resolve reference to bean 'marshaller' while setting bean property 'marshaller'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [webservices.xml]: Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [webservices.xml]: Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1

after deep diving into a lot of config an other WebLogic settings I found one settings, which was caused the problem. Within the startup of the WebLogic we used some of the tuning options HP recommends for performance reasons:

-XX:-StackTraceInThrowable



after removing that flag from the startup everything went fine. Looks like one of the initialization routines of Jaxb2 or of one of their dependent libs rely on interpreting the StackTrace. With that option we remove the stacktrace and with that we remove the chance for interpreting getStackTrace().

Dirk finally find out the reason for this error within the jaxb implementation. The jaxb uses a Util class, which uses the follwoing code

public static Logger getClassLogger() {
    try {
      StackTraceElement[] trace = new Exception().getStackTrace();      return Logger.getLogger(trace[1].getClassName());    } catch( SecurityException _ ) {
      return Logger.getLogger("com.sun.xml.bind"); // use the default    }
}
well and that's it. The getStackTrace method returns null if the parm -StackTraceInThrowable is set thus resulting in ArrayIndexOutOfBoundsException. Thanks for not catching Exception beside Security Exception.