Why isn't this SalesforceCanvasFrameworkSDK “Hello World” application for SFDC Canvas working? - exception

Currently I'm looking in the Force.com Canvas Developer's Guide at "Chapter 3: Quick Start--Advanced".
I've successfully cloned SalesforceCanvasFrameworkSDK from GitHub, and am now trying to Run the Web App Locally.
The build is successful and keystore has been created. However, when I execute target\bin\webapp.bat, I get the following error:
Error: Could not find or load main class Main
Find that the main class seems to be in C:\SalesforceCanvasFrameworkSDK\target\classes, I modified the .bat file, to include this in the CLASSPATH:
set CLASSPATH="C:\SalesforceCanvasFrameworkSDK\target\classes;%BASEDIR%"\etc;"%REPO%"\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;"%REPO%"\org\mortbay\jetty\jsp-2.1-glassfish\2.1.v20100127\jsp-2.1-glassfish-2.1.v20100127.jar;"%REPO%"\org\eclipse\jdt\core\compiler\ecj\3.5.1\ecj-3.5.1.jar;"%REPO%"\org\mortbay\jetty\jsp-api-2.1-glassfish\2.1.v20100127\jsp-api-2.1-glassfish-2.1.v20100127.jar;"%REPO%"\ant\ant\1.6.5\ant-1.6.5.jar;"%REPO%"\org\codehaus\jackson\jackson-mapper-asl\1.9.0\jackson-mapper-asl-1.9.0.jar;"%REPO%"\org\codehaus\jackson\jackson-core-asl\1.9.0\jackson-core-asl-1.9.0.jar;"%REPO%"\org\eclipse\jetty\jetty-webapp\7.6.0.v20120127\jetty-webapp-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-xml\7.6.0.v20120127\jetty-xml-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-util\7.6.0.v20120127\jetty-util-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-servlet\7.6.0.v20120127\jetty-servlet-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-security\7.6.0.v20120127\jetty-security-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-server\7.6.0.v20120127\jetty-server-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-continuation\7.6.0.v20120127\jetty-continuation-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-http\7.6.0.v20120127\jetty-http-7.6.0.v20120127.jar;"%REPO%"\org\eclipse\jetty\jetty-io\7.6.0.v20120127\jetty-io-7.6.0.v20120127.jar;"%REPO%"\asm\asm\3.2\asm-3.2.jar;"%REPO%"\org\json\json\20080701\json-20080701.jar;"%REPO%"\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;"%REPO%"\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;"%REPO%"\commons-codec\commons-codec\1.4\commons-codec-1.4.jar;"%REPO%"\sfdc\sfdc-canvas-sdk\1.0-SNAPSHOT\sfdc-canvas-sdk-1.0-SNAPSHOT.jar
This enables the batch file to execute and initiate Jetty.
However, when I attempt to visit https://localhost:8443/examples/hello-world/index.jsp, after getting past the browser warning message, I get an HTTP ERROR 500 page:
HTTP ERROR 500
Problem accessing /examples/hello-world/index.jsp. Reason:
PWC6033: Unable to compile class for JSP
PWC6199: Generated servlet error: The type java.util.Map$Entry cannot
be resolved. It is indirectly referenced from required .class files
Caused by:
org.apache.jasper.JasperException: PWC6033: Unable to compile class
for JSP
PWC6199: Generated servlet error: The type java.util.Map$Entry cannot
be resolved. It is indirectly referenced from required .class files
at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:123)
at
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:296)
at
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:376)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437) at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349) at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at
org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at
org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at
org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:665)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745) Powered by Jetty://
Concurrently, my Jetty server dies with:
ERROR: Compilation error
org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:372)
at org.apache.jasper.compiler.JDTJavaCompiler$1.findType(JDTJavaCompiler.java:367)
at org.apache.jasper.compiler.JDTJavaCompiler$1.findType(JDTJavaCompiler.java:324)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:102)
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:122)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1188)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromVariantTypeSignature(LookupEnvironment.java
:1244)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeArgumentsFromSignature(LookupEnvironment.java:1
031)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1193)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:495)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:577)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:327)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:640)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:619)
at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:295)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:133)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:183)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:465)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:519)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:368)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:444)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:752)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:464)
at org.apache.jasper.compiler.JDTJavaCompiler.compile(JDTJavaCompiler.java:503)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:368)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:665)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745) ERROR: Error compiling file:
C:\Users\Brian_Kessler#epam.com\AppData\Local\Temp\jetty-0.0.0.0-8443-webapp-_-any-\jsp\org\apa
che\jsp\examples\hello_002dworld\index_jsp.java 2014-12-11
15:35:48.106:WARN:oejs.ServletHandler:/examples/hello-world/index.jsp
org.apache.jasper.JasperException: PWC6033: Unable to compile class
for JSP||PWC6199: Generated servlet error:|The type java
.util.Map$Entry cannot be resolved. It is indirectly referenced from
required .class files||
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:123)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:296)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:376)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:665)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745)
If it is relevant:
OS: Windows 7
Java: 1.8.0_25
Maven: 3.2.2
Any help to resolve this will be appreciated!

I was able to fix this as follows on MacOS Sierra 10.13.6
The problem does seem to be with Java 8, so if you can start the whole installation with Java 7, you'll save a lot of time. In my case, I had already installed Java 8, so I had to do the following:
1- Install java 7 from: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html . You have to create an Oracle account, it's free.
2- Confirm both versions of java are runningv
Pablos-MacBook-Pro:SalesforceCanvasFrameworkSDK pabloalvarez$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.0_191, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
1.7.0_80, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
3- Then
export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_80`
export JAVACMD=`/usr/libexec/java_home -v 1.7.0_80`
Confirm that Java 7 is the default version now
Pablos-MacBook-Pro:SalesforceCanvasFrameworkSDK pabloalvarez$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
5- Then
export JAVACMD=/usr/bin/java
6- Finally
Pablos-MacBook-Pro:SalesforceCanvasFrameworkSDK pabloalvarez$ sh target/bin/webapp
Looks like we are NOT running on heroku.
2019-01-14 10:54:48.557:INFO:oejs.Server:jetty-7.6.0.v20120127
2019-01-14 10:54:48.863:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/,file:/Users/pabloalvarez/SalesforceCanvasFrameworkSDK/src/main/webapp/}
2019-01-14 10:54:49.252:INFO:oejus.SslContextFactory:Enabled Protocols [SSLv2Hello, TLSv1, TLSv1.1, TLSv1.2] of [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2]
Good luck!

Related

Upgade app from 'EntityFramework, Version=4.6.1.0 to Version 6.3.1 or greater

I have existing app that uses MySQL Server. Some errors I was getting when trying to add a new feature led me to upgrading to 'MySql.Data.EntityFramework 8.0.11'.
error I am getting when on:
public CitiesContext() : base("name=CitiesContext"):
An error occurred creating the configuration section handler for entityFramework: Could not load file or assembly 'EntityFramework, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Under my properties, my target framework is still version 4.6.1.
Is there a 'how to document' somewhere on how to upgrade the EntityFrame work? I know several of the other installed packages were installed while targeting v 4.6.1, so lots of other types of errors using (like hay this was compiled with v 4.6) when trying to compile with a web.congf using
I have installed
PM> Install-Package EntityFramework -Version 6.4.4
Package 'EntityFramework.6.4.4' already exists in project 'Lat34North'
Time Elapsed: 00:00:00.0186347
Please note. This is a hobby for me, not a profession. The app is written using asp.net mvs an first issued in 2018. Do I just need to change the target in the properties and upgrade all the other packages??
Thank you for any help.

Error building server: An error occurred while resigning test.apk

Whenever i try to run the following command:
java -jar selendroid-standalone-0.15.0-with-dependencies.jar -app test.apk
I get the following error:
io.selendroid.standalone.SelendroidLauncher launchServer
SEVERE: Error building server: An error occurred while resigning the app 'test.apk'.
Exception in thread "main" io.selendroid.server.common.exceptions.SessionNotCreatedException: An error occurred while resigning the app 'test.apk'.
The same question has been posted earlier.
Kindly respond if anyone has the solution to it.
Thanks.
System requirements on the selenroid website:
Java SDK (minimum 1.6) must be installed and JAVA_HOME configured. IMPORTANT: If JAVA_HOME is pointing to a Java runtime environment, selendroid will produce errors because tools like the jarsigner are not available!

Getting 'java.sql.SQLException: com.mysql.jdbc.Driver' with grails run-app (when BuildConfig.groovy doesn't need to be recompiled)

I've upgraded my grails application from 1.3.9 to 2.2.3 and then to 2.3.3. I read the release and upgrade notes for 1.3.9->2.2.3 and then from 2.2.3->2.3.3
I am using OpenJDK 6, Jetty 6 and the plugin jetty 1.1, MySQL 5.5 and I have the connector library under lib
Now my issue is if I run grails clean and then grails run-app the application runs without any problems but if I stop it and run grails run-app again I get a gigantic error (see here: http://pastebin.com/36MpXhir)
I also found that changing something like adding a space somewhere in BuildConfig.groovy (anything that makes it be recompiled) makes the application run normally.
Looking at the stacktrace the first thing that puzzles me is
[02.12.13 16:13:59.919] [main] pool.ConnectionPool Unable to create initial connections of pool.
java.sql.SQLException: com.mysql.jdbc.Driver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:162)
There are references to org.apache.tomcat even though I'm using jetty (and removed tomcat from BuildConfig.groovy).
Did anyone else encounter such a problem?
Don't put jar files in the lib directory if they're available in a public Maven repo. It's far better to download jars once and keep them in a local cache, and reuse them as needed.
The MySQL driver is used as the commented-out example in the generated BuildConfig.groovy - just un-comment it :) You might want to bump up the version to the latest, e.g.
dependencies {
runtime 'mysql:mysql-connector-java:5.1.27'
}
This is a good site for finding Maven artifacts: http://mvnrepository.com/artifact/mysql/mysql-connector-java
If you do have a jar that's not in a Maven repo (e.g. one with shared code at your company) then you can put it in the lib directory, but it's not auto-discovered. Run grails compile --refresh-dependencies to get it added to the classpath.
For me same error has occurred while running the Grails Application.Then I debug and view the code history of my code which was committed recently.
From that I found the issue that was:
Inside the controller file I send the instance with-out properly
Eg:
**def list=[personInstance.]---> error occurred.**
**render list as JSON**
Then I correct my mistake-->clean the app --> run the app
Now its working fine.

Jdbc driver error : jdbc.NonRegisteringDriver

I am getting the below error when i am trying to connect to my database.
Exception in thread "main" java.lang.NoClassDefFoundError: java.util.concurrent.ConcurrentHashMap
at com.mysql.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:83)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at test.main(test.java:14)
Information :
Platform : RHEL 5
Java : jdk1.6.0_45
jdbc connector : mysql-connector-java-5.1.26-bin.jar
Sever: Tomcat 6
I have placed the jdbc connector inside usr/share/java/ Directory.
and my program to test the connection is placed in the root folder.
I have set the CLASSPATH to point to the connector using EXPORT command.
and I am using javac filename.java command to compile & java filename to run it.
A JDBC driver doesn't need to be installed or configured. You download the jar, add it to the runtime classpath of your application, and you're done:
java -cp someJar.jar:someDirectory:theMySQLJdbcDriver.jar com.foo.bar.Main
I have installed the old version of mysql connector which was compatible with RHEL5
and now its working fine.
Thanks !!

ClassNoDefFoundError while running a junit test which is instrumented using TPTP probekit agent

I've been dealing with this error message for a while now and nobody has been able to help me...
I am trying to probe a java application using the standalone TPTP probekit agent with the following linux command:
java '-agentlib:JPIBootLoader=JPIAgent:server=standalone;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=ome/anis/qf-t/core/probe/testProbe.probescript' junit.textui.TestRunner quickfix.test.acceptance.AcceptanceTestSuite
My application is actually a junit testcase from the Quickfixj package (quickfixj.org)...
Running the above command, the probing starts and I am able to see the runtime traces. However, at some point during execution I am getting the runtime exception:
java.lang.NoClassDefFoundError: testProbe_probe$Probe_0
25-Jan-2012 10:25:11 AM quickfix.test.acceptance.ATServer run
SEVERE: error in AT server
java.lang.NoClassDefFoundError: testProbe_probe$Probe_0
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.<init>(DocumentBuilderFactoryImpl.java)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:233)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
at quickfix.DataDictionary.load(DataDictionary.java:906)
at quickfix.DataDictionary.read(DataDictionary.java:893)
at quickfix.DataDictionary.<init>(DataDictionary.java:109)
at quickfix.DefaultSessionFactory.getDataDictionary(DefaultSessionFactory.java:325)
at quickfix.DefaultSessionFactory.createDataDictionary(DefaultSessionFactory.java:219)
at quickfix.DefaultSessionFactory.processFixtDataDictionaries(DefaultSessionFactory.java:258)
at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:113)
at quickfix.mina.acceptor.AbstractSocketAcceptor.createSessions(AbstractSocketAcceptor.java:242)
at quickfix.mina.acceptor.AbstractSocketAcceptor.startAcceptingConnections(AbstractSocketAcceptor.java:99)
at quickfix.SocketAcceptor.initialize(SocketAcceptor.java:66)
at quickfix.SocketAcceptor.start(SocketAcceptor.java:59)
at quickfix.test.acceptance.ATServer.run(ATServer.java:193)
at java.lang.Thread.run(Thread.java:662)**
which states that my probe file is missing. But this file has been needed in the first place to print the traces!!???.....
Well, here are some facts:
I am able to probe other applications, including a simple junit test:
java '-agentlib:JPIBootLoader=JPIAgent:server=standalone;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=ome/anis/qf-t/core/probe/testProbe.probescript' junit.textui.TestRunner quickfix.test.acceptance.AnisJUnitTestExample
I am able to run the quickfix.test.acceptance.AcceptanceTestSuite using junit (no probing):
java junit.textui.TestRunner quickfix.test.acceptance.AcceptanceTestSuite
I have set the path to testProbe_probe$Probe_0 in CLASSPATH
I have called the System.getenv("CLASSPATH") from within my testcase and the CLASSPATH seems to be fine
My testcase deals with threads, sockets, etc
And my system configuration is:
-os: ubuntu 10.04-64bit (on VirtualBox!)
-java version "1.6.0_24"
-junit: junit-4.10.jar
-TPTP agent controller: agntctrl.linux_em64t-TPTP-4.7.2
Any ideas??
Thanks,
Anis