Deploy Java application using Bluemix Liberty for Java - java

We are trying to deploy a spring-based Java application to Bluemix using the Liberty for Java buildpack. We see the error below. We are not even using the org.apache.tiles package. The same application build works fine on a development Tomcat server.
Stack Dump = java.lang.NoClassDefFoundError: org.apache.tiles.el.ScopeELResolver
at java.lang.J9VMInternals.prepareClassImpl(Native Method)
at java.lang.J9VMInternals.prepare(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at com.ibm.wsspi.injectionengine.MethodMap.getMethods(MethodMap.java:150
)
at com.ibm.wsspi.injectionengine.MethodMap.getAllDeclaredMethods(MethodM
ap.java:86)
at com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredMe
thods(InjectionProcessorManager.java:430)
at com.ibm.ws.injectionengine.InjectionProcessorManager.processAnnotatio
ns(InjectionProcessorManager.java:231)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMe
taData(AbstractInjectionEngine.java:514)
at com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl.proc
essInjectionMetaData(OSGiInjectionEngineImpl.java:239)
at com.ibm.ws.injectionengine.ReferenceContextImpl.processImpl(Reference
ContextImpl.java:633)
at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceCont
extImpl.java:305)
at com.ibm.ws.injectionengine.osgi.internal.OSGiReferenceContextImpl.pro
o
cess(OSGiReferenceContextImpl.java:31)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.commonInitializationStart(
WebApp.java:254)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1038)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6565)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVi
rtualHost.java:468)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(D
ynamicVirtualHost.java:463)
at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebCont
ainer.java:1051)
at com.ibm.ws.webcontainer.osgi.WebContainer.access$000(WebContainer.jav
a:104)
at com.ibm.ws.webcontainer.osgi.WebContainer$2.run(WebContainer.java:870
)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.tiles.el.ScopeELResolver
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibrar
yClassLoaders(AppClassLoader.java:499)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoa
der.java:282)
at java.lang.ClassLoader.loadClassHelper(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadCla
ss(AppClassLoader.java:477)

Related

Apache Tomcat home page not coming

I installed Apache server (Tomcat 7.63) on client machine (Window 7 system 32 bit), The Java version used in client machine is (JDK 1.8 update 60)
Problem
Tomcat server is started by running the file (...\bin\Tomcat7.exe). But when I tried to open the home page (http://localhost:8080/) it is not coming on browser and I can see the following exception on Apache log:
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process
SEVERE: Error reading request, ignored
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider.lookup(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider.access$000(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
at sun.nio.cs.AbstractCharsetProvider$1.next(Unknown Source)
at java.nio.charset.Charset.put(Unknown Source)
at java.nio.charset.Charset.access$200(Unknown Source)
at java.nio.charset.Charset$3.run(Unknown Source)
at java.nio.charset.Charset$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.nio.charset.Charset.availableCharsets(Unknown Source)
at org.apache.tomcat.util.buf.B2CConverter.<clinit>(B2CConverter.java:51
)
at org.apache.tomcat.util.buf.ByteChunk.<clinit>(ByteChunk.java:102)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:58)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:36)
at org.apache.tomcat.util.buf.MessageBytes$MessageBytesFactory.newInstan
ce(MessageBytes.java:685)
at org.apache.tomcat.util.buf.MessageBytes.newInstance(MessageBytes.java
:78)
at org.apache.coyote.Request.<init>(Request.java:83)
at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:61)
at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp1
1Processor.java:273)
at org.apache.coyote.http11.Http11Processor.<init>(Http11Processor.java:
56)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.creat
eProcessor(Http11Protocol.java:165)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.creat
eProcessor(Http11Protocol.java:103)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:586)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at sun.nio.cs.CharsetMapping.load(Unknown Source)
at sun.nio.cs.CharsetMapping$1.run(Unknown Source)
at sun.nio.cs.CharsetMapping$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.cs.CharsetMapping.get(Unknown Source)
at sun.nio.cs.ext.SJIS_0213$1.run(Unknown Source)
at sun.nio.cs.ext.SJIS_0213$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.cs.ext.SJIS_0213.<clinit>(Unknown Source)
... 30 more
Exception in thread "http-bio-8085-exec-1" java.lang.NullPointerException
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:731)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
at java.lang.Thread.run(Unknown Source)
What is really weird to me that if I start Apache server from Services Management Console from the administrator account: Administrative Tools -> Services , it is working fine and I can see that the home page (http://localhost:8080/) is coming on browser.
Question
Why Apache home page is not coming if we run Apache server using the .exe file (...\bin\Tomcat7.exe) ? Why the home page is coming if the server started using Windows service ? In both cases the same .exe file is execute to run the server, what is the difference between the two cases ?
Tomcat cannot be started by using the exe directly (unless the correct parameters are supplied), you should use one of the included .bat files if you want to do that: startup.bat
Just be sure to define your environment variables, such as JAVA_HOME, and/or JRE_HOME

Unable to run javafx app on windows 8.1

I made a javafx desktop application using intellij idea and packaged it as given in this link. It works fine on my pc which has windows 7. But when run on windows 8.1, it gives this exception:
java.lang.NullPointerException
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(Un
known Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(Unk
nown Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.paintTiles(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.BaseNode.render(Unknown Source)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(Unknown Source)
at com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at com.sun.prism.render.RenderJob.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknow
n Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.sun.prism.impl.BaseResourceFactory.clearTextureCache(Unknown Sour
ce)
at com.sun.prism.impl.BaseResourceFactory.getCachedTexture(Unknown Sourc
e)
at com.sun.prism.impl.BaseResourceFactory.getCachedTexture(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(Un
known Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(Unk
nown Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.paintTiles(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.BaseNode.render(Unknown Source)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(Unknown Source)
at com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at com.sun.prism.render.RenderJob.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknow
n Source)
at java.lang.Thread.run(Unknown Source)
So is it that javafx does not work on windows 8? I dont think its given anywhere like that. After all its a typical java application, so it should work if we have jre installed.
What could be the solution to this?
EDIT:
Here is something strange observed:
Artifacts built using intellij idea 12.0.4 are working fine on windows 8 as well. But when built throught intellij idea 13.0.1 are giving the error.

Failing to create new PoolingHttpClientConnectionManager

My program contains the following line, and just hangs at this point, and I'm not quite sure why.
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
When debugging in Eclipse, if I try to evaluate "new PoolingHttpClientConnectionManager()" in the Display view I get these errors:
java.lang.NoClassDefFoundError: org/apache/http/config/Lookup
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
...omitted - referring to specific lines in code...
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.http.config.Lookup
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
I am using httpclient.jar version 4.3.1 from org.apache.httpcomponents.
Anyone else experience this problem? Any solution? Or am I doing something silly?
Do you also have httpcore jar? (version 4.3 as well) I've found that class there.
The org.apache.http.config.Lookup class is not in httpclient-4.3.1.jar. It is in httpcore-4.3.jar.
If you are not using Maven, to understand the httpclient dependencies, see http://hc.apache.org/httpcomponents-client-4.3.x/httpclient/dependencies.html
Maybe you forgot to include/download HttpCore
http://hc.apache.org/downloads.cgi

using java applet in google app engine project

I have a question about using java applet on google app engine. I created 2 classes called InteractiveGraphView1 and SimpleApplet. Using an object of InteractiveGraphView1 inside SimpleApplet. Anyway, I'm using some external jars for these 2 classes. I created a jar for my project called "GraphApplet". Then I put this jar into WEB-INF/lib and also I add it into gae project as external jar. To be sure I also added external jars that I used in GraphApplet class into my gae project. I deployed the gae project and when I tried to run applet it gives me this error:
load: class SimpleApplet.class not found.
java.lang.ClassNotFoundException: SimpleApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: SimpleApplet.class
java.lang.RuntimeException: java.lang.NoClassDefFoundError: edu/uci/ics/jung/algorithms/layout/Layout
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: edu/uci/ics/jung/algorithms/layout/Layout
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: edu.uci.ics.jung.algorithms.layout.Layout
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 20 more
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: edu/uci/ics/jung/algorithms/layout/Layout
What should I do?
P.S. I forgot to tell that I'm using JUNG library in my GraphApplet project. I also added this into google app engine project
Adding into HMTL
<html>
Hello App Engine
This is my page<br>
Below you see an applet<br>
<br>
<Applet Code="SimpleApplet.java" archive="graphic.jar" width=200 Height=200>
</Applet>
Applet is just a jar file that is downloaded by browser and executed on client side as applet.
It has nothing to do with server code. From the point of server it's just a static file. So you should not pout it inside WEB-INF/lib, where server libs reside. Just put it next to your html files.
For an applet referring to other jars see: How do I build an applet which needs an external jar, using ant?
Just put your applet.jar to root of WAR directory

Java Web Start Error FileNotFoundException

So Im trying to use webstart on this application of mine and I keep getting this error:
java.io.FileNotFoundException:
http://www.fenixflame.net/DropLogger/Drop Logger.jar at
sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method) at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown
Source) at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown
Source) at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown
Source) at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown
Source) at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown
Source) at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown
Source) at
com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown
Source) at
com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown
Source) at com.sun.deploy.net.DownloadEngine.getResource(Unknown
Source) at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown
Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at java.util.concurrent.FutureTask.run(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) Caused by:
java.io.FileNotFoundException:
http://www.fenixflame.net/DropLogger/Drop Logger.jar at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source)
... 15 more
This is my First time using webstart. I tested it out with simple applications and it worked just fine. I think it might have something to do with the fact that the application tries to read a local file when its launched.
Cannot post more than 2 links but you can check it out here:
fenixflame.net/DropLogger/launch.html
Yes problem was the space on the .jar file. I changed it and it worked just fine.
Its not possible to change the .jar file name inside netBeans, you can only change the project name but that doesnt change the file name. The only way to do change the .jar name is going to the project .xml file or creating a new project with the name you want for your jar file and copying all ur packages there.

Categories

Resources