Friday, September 15, 2006

non singleton bean initialization

Bit me.
Sympton: javax.management.InstanceAlreadyExistsException
Cause: one singleton bean a was calling ApplicationContext.getBean(), while another web.xml defined non-singleton bean b was statically calling ApplicationContext.getBean(a)

Doh!

Moral: never load beans statically, put in initialization or class constructor

Thursday, September 07, 2006

more WebLogic nuances: expanding archives at runtime is slow

When you deploy in exploded format, WebLogic copies the exploded directory structure into its temporary working directory upon deployment.

If the exploded format contains .jars, those jars are just copied, not expanded.

At runtime, if you reference a class that the classloader finds in the jar, it unpacks the archive at runtime, then loads the class.

"If you are unpacking an archive file that contains other module archive files (for example, an Enterprise Application or Web Service that includes JAR or WAR files) and you want to perform partial updates of those modules, you must expand the embedded archive files as well. Make sure that you unpack each module into a subdirectory having the same name as the archive file. For example, unpack a module named myejb.jar into a /myejb.jar subdirectory of the exploded Enterprise Application directory."

BEA link that hints at issue

Do not know whether this affects deployment in archive format of a war that contains a jar, have not tried.

Thread [[STUCK] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] (Suspended)
Inflater.inflateBytes(byte[], int, int) line: not available [native method]
Inflater.inflate(byte[], int, int) line: 219
ZipFile$2(InflaterInputStream).read(byte[], int, int) line: 128
DataInputStream.readFully(byte[], int, int) line: 176
JarFile.getBytes(ZipEntry) line: 357
JarFile.initializeVerifier() line: 314
JarFile.getInputStream(ZipEntry) line: 383
GenericClassLoader$JarSource(ZipSource).getInputStream() line: 38
GenericClassLoader$JarSource(ZipSource).getBytes() line: 69
ChangeAwareClassLoader(GenericClassLoader).defineClass(String, Source) line: 250
ChangeAwareClassLoader(GenericClassLoader).findLocalClass(String) line: 227
ChangeAwareClassLoader(GenericClassLoader).findClass(String) line: 195
ChangeAwareClassLoader.findClass(String) line: 54
ChangeAwareClassLoader(ClassLoader).loadClass(String, boolean) line: 306
ChangeAwareClassLoader(ClassLoader).loadClass(String) line: 251
ChangeAwareClassLoader(GenericClassLoader).loadClass(String) line: 130
ChangeAwareClassLoader.loadClass(String) line: 35
ChangeAwareClassLoader(ClassLoader).loadClassInternal(String) line: 319
b.() line: not available
a.() line: not available
bg.Z() line: not available
bg.y(e, boolean) line: not available
bg.a(boolean) line: not available
bg(ag).a(String, bm, boolean) line: not available
bg(ag).if(String, bm, boolean) line: not available
bg.if(String, bm, boolean) line: not available
bg.y(String, bm, boolean, f3, Locale) line: not available
a.a(String, Locale) line: not available
g.if(FetchDataDocumentRequest, Locale) line: not available
JRCCommunicationAdapter.request(int, int, String, ISecurityContext, IXMLSerializable) line: not available
y.a(ISecurityContext, String, int, int, IXMLSerializable, k) line: not available
r.a(int, int, IXMLSerializable, k) line: not available
ReportClientDocument.if(int, int, IXMLSerializable) line: not available
ReportClientDocument.if(PropertyBag, int) line: not available
ReportClientDocument.a(PropertyBag, int) line: not available
ReportClientDocument(ClientDocument).open(Object, int) line: not available
ReportClientDocument.open(Object, int) line: not available
GRV.sR(HttpSession, HttpServletRequest, HttpServletResponse, ServletContext, OutputStream) line: 71
RMSBImpl.sR(HttpSession, HttpServletRequest, HttpServletResponse, ServletContext) line: 255
rRR.jsp line: 3
__rrr(JspBase).service(ServletRequest, ServletResponse) line: 34
StubSecurityHelper$ServletServiceAction.run() line: 225
StubSecurityHelper.invokeServlet(ServletRequest, HttpServletRequest, ServletRequestImpl, ServletResponse, HttpServletResponse, Servlet) line: 127
JavelinxJSPStub(ServletStubImpl).execute(ServletRequest, ServletResponse, FilterChainImpl) line: 272
ServletStubImpl.onAddToMapException(Throwable, ServletRequestImpl, ServletRequest, ServletResponse, FilterChainImpl) line: 380
ServletStubImpl.execute(ServletRequest, ServletResponse, FilterChainImpl) line: 298
ServletStubImpl.execute(ServletRequest, ServletResponse) line: 165
RequestDispatcherImpl.invokeServlet(boolean, ServletRequest, ServletResponse, ServletResponseImpl, int) line: 493
RequestDispatcherImpl.forward(ServletRequest, ServletResponse) line: 245
TilesRequestProcessor(RequestProcessor).doForward(String, HttpServletRequest, HttpServletResponse) line: 1085
TilesRequestProcessor(TilesRequestProcessor).doForward(String, HttpServletRequest, HttpServletResponse) line: 263
TilesRequestProcessor.doForward(String, HttpServletRequest, HttpServletResponse) line: 74
TilesRequestProcessor(RequestProcessor).processForwardConfig(HttpServletRequest, HttpServletResponse, ForwardConfig) line: 398
TilesRequestProcessor(TilesRequestProcessor).processForwardConfig(HttpServletRequest, HttpServletResponse, ForwardConfig) line: 318
TilesRequestProcessor(RequestProcessor).process(HttpServletRequest, HttpServletResponse) line: 241
TilesRequestProcessor.process(HttpServletRequest, HttpServletResponse) line: 89
ActionServlet.process(HttpServletRequest, HttpServletResponse) line: 1196
ActionServlet.doPost(HttpServletRequest, HttpServletResponse) line: 432
ActionServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 763
ActionServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 856
StubSecurityHelper$ServletServiceAction.run() line: 225
StubSecurityHelper.invokeServlet(ServletRequest, HttpServletRequest, ServletRequestImpl, ServletResponse, HttpServletResponse, Servlet) line: 127
ServletStubImpl.execute(ServletRequest, ServletResponse, FilterChainImpl) line: 272
TailFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 26
FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 42
SetCharacterEncodingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 32
FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 42
WebAppServletContext$ServletInvocationAction.run() line: 3151
AuthenticatedSubject.doAs(AbstractSubject, PrivilegedAction) line: 321
SecurityManager.runAs(AuthenticatedSubject, AuthenticatedSubject, PrivilegedAction) line: 121
WebAppServletContext.securedExecute(HttpServletRequest, HttpServletResponse, boolean) line: 1973
WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl) line: 1880
ServletRequestImpl.run() line: 1310
ExecuteThread.execute(Runnable) line: 207
ExecuteThread.run() line: 179

Friday, September 01, 2006

Internet Explorer bug is a feature

Let's see. I am generating a web page for a user to see. It expires immediately, so I apply the HTTP "Cache-Control" setting to "no-cache".

What does Internet Explorer do with that? Refuses to display it. After all, if it can't cache it, it tries to be "security conscious" and refuses to put it on the filesystem, and IE can't display any content unless its rendered to the filesystem.

IE bug 316431

Use Cache-Control: must-revalidate, max-age=0
to get around this non-compliant behaviour.