jdbc issue on tomcat6 with birt - java

first and foremost, i know very little about tomcat6, and it's been a long time since i've done complex java work.
so my friends server went down, and i'm trying to get things working on a new system (Ubuntu 12.04, with Tomcat6).
his site had a link to some birt reports, but they aren't working. it looks like there is a problem with the jdbc mysql driver.
here is what i've got:
in catalina.sh, i've got
CLASSPATH=$CLASSPATH:/usr/share/java
in that directory, i've got (obviously, more in here than just these things):
mysql-connector-java-5.1.16.jar
mysql-connector-java.jar
mysql.jar
the birt stuff is deployed in /var/lib/tomcat6/webapps/WebViewerExample , and in there i see the WEB-INF/lib directory, to which i've also copied the mysql-connector jar files.
i set birt up so that it will log stuff, and this is the error it's giving me:
Sep 1, 2012 3:49:51 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: refreshUrlsWhenFail: true
Sep 1, 2012 3:49:51 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: driverClassPath: null
Sep 1, 2012 3:49:51 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: Registered URLs:
Sep 1, 2012 3:49:51 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNING: Failed to load JDBC driver class: com.mysql.jdbc.Driver
Sep 1, 2012 3:49:51 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Unable to open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: com.mysql.jdbc.Driver.
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.findDriver(JDBCDriverManager.java:782)
.... Huge stack trace...
so i don't know a lot about java and tomcat. any clue on what i can do to get this to work?

Jars like JDBC drivers should be added into global classpath. You need to put the mysql-connector-java-5.1.16.jar to tomcat's lib directory. Put it into ${tomcat.dir}/lib folder and remove mysql jar from WEB-INF/lib.

Related

Bind Asterisk to my Java program via AGI

I am trying to bind Asterisk to my java program.
I followed this article (http://www.jcgonzalez.com/asterisk-handle-calls-with-java-example) to the letter. But I have an error once I call the 888 extention. It gives me the following error :
Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Thread pool started.
Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Listening on *:4573.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Received connection from /127.0.0.1
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
INFO: Resource bundle 'fastagi-mapping' not found.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.AbstractMappingStrategy createAgiScriptInstance
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')
I have just switched to UBUNTU, and I have no idea what this sentence means : make sure the fastagi-mapping.properties is in the class path or put it in the same folder as your compiled classes.
Please help.
Actually you have to put hello.agi mapping with actual java class file in fastagi-mapping.properties file , so that it can find the corresponding AGI file that u call from asterisk..
Your error have no any relation to AGI.
Your error say you have no class in path(or mistype)
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')
Note, class used WILL depend of url used when calling agi in dialplan.

ClassNotFoundException while starting the Tomcat 7 Server in MyEclipse

I am using MyEclipse 9 and Tomcat7.0 . I have taken latest code and deployed in Tomcat 7 and started the server. Immediately i got an error log as mentioned below.
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.aap.apweb.servlet.APServletContextListener
java.lang.ClassNotFoundException: com.aap.apweb.servlet.APServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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:662)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.aap.apweb.servlet.APHTTPSessionListener
java.lang.ClassNotFoundException: com.aap.apweb.servlet.APHTTPSessionListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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:662)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jan 10, 2014 5:53:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/apweb] startup failed due to previous errors
Jan 10, 2014 5:53:41 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/apweb] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jan 10, 2014 5:53:41 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jan 10, 2014 5:53:41 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jan 10, 2014 5:53:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13243 ms
I think the jars path has to be set. But i am not able to find it.
Is com.aap.apweb.servlet.APHTTPSessionListener one of your classes? I don't get any hits on Google so I'm guessing it is. You need to ensure that you have set all dependencies in your build path and set deployment policies accordingly. Deployment policies for the project can be adjusted by right clicking on the project, selecting Properties, then going to the MyEclipse/Web page and clicking the Deployment tab. On that tab, you can choose to use the workbench settings (in which case most fields will be grayed out) or not (just deselect the "Use workbench default settings").
Note that the most recent release of MyEclipse gives you more explicit control over deployment, via a deployment assembly. A license for MyEclipse 9 also applies to MyEclipse 2014, which can be downloaded from the www.myeclipseide.com web site.
Right click on project
then go to build path -> add library in libraries pane.
then select server run time then add apache tomcat and then try to run your application.
You can export the required projects as jar files and place them in your .WAR file in WEB-INF\lib .This ensures that your classes from your jar files get loaded during application startup.
As per this line from the log:
The web application [/apweb] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
I have added db2 jdbc 1.6 jars(db2jcc4.jar and db2jcc4_license_cisuz.jar)to my project build path. These jars solved my problem while restarting the server. It started without any issue.
Thanks for all the geeks to responding me.
I am getting the same error when I started tomcat server in Eclipse Luna environment. And my OS is Ubuntu.
Actually the problem is when I build the project the web module not create the M2e-wtp maven folder. When we start the tomcat server it could not see the maven dependencies. That's while the exception came.
I resolve this issue by Downloading the latest Mars eclipse. And again I checked out my project.
After clean installed my project the issue was resolved. It's working fine.

unable to run solr on tomcat in linux(404 not found /solr)

I am trying to integrate solr on tomcat. I have tried from almost a couple of blogs
http://www.beingjavaguys.com/2013/01/if-you-want-to-configure-solr4_19.html
http://wiki.apache.org/solr/SolrTomcat
But every time I am faced with the 404 not found page when trying to run-
localhost:4040/solr-4.4.0
On trying to start the webapp from tomcat manager its throwing
FAIL - Application at context path /solr-4.4.0 could not be started
I have checked the catalina.logs file
Sep 27, 2013 10:30:09 AM org.apache.catalina.core.StandardContext
startInternal SEVERE: Error filterStart Sep 27, 2013 10:30:09 AM
org.apache.catalina.core.StandardContext startInternal SEVERE: Context
[/solr-4.4.0] startup failed due to previous errors Sep 27, 2013
10:31:24 AM org.apache.catalina.startup.HostConfig deployWAR INFO:
Deploying web application archive AM.war Sep 27, 2013 10:31:24 AM
org.apache.catalina.loader.WebappClassLoader validateJarFile INFO:
validateJarFile(/root/Downloads/apache-tomcat-7.0.21/webapps/AM/WEB-INF/lib/servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Any help here will be highly appreciated.
There was change in the way logging is implemented in Solr version 4.3 and higher. Please follow the directions outlined in Solr Logging - Using the example logging setup in containers other than Jetty for steps on how to setup logging to work properly with Tomcat.
Have you copied all jars from your solr home distribution to tomcat bin. make sure you copy all jars solr_home/bin & solr_home/bin/etc to tomcat lib folder and then give it a try.

Create web service using Eclipse

I am trying to create my first webservice using eclipse javaEE under Axis2,
i am following this turorial eclipse tutorial
to learn how to make it.I make the webservice but when i want to assure that the ws has been deployed through viewing it through URL, an HTTP status 400 occure. How can I know what is the error??
here what i make exactly:
i make the settings in preferences [ ant , axis2, tomcat and java ].
New -> New dynamic web page
new ->java (I create the class i want to convert to ws)
new ->web service (i want to create bottom up ws).
type http://localhost:8080/Axis2/services/listservices in the url of browser
this what return HTTP Status 404 - /services/listservices
can some one tell me how can i know what is the error? or how can i define it?
EDIT:
an exception happen in the console of eclipse which is :
org.apache.axis2.transport.http.AxisAdminServlet java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet
what should I do ,in the configuration i specify where is axis2 and eclipse shows
Axis2 runtime loaded successfully
after creating new work space and create webservice again, this is the output appears in console
Dec 20, 2010 8:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0_18\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/alaa college/year 4/1st
semester/Advance sw/Libraries/eclipse/jre/bin/client;F:/alaa college/year 4/1st
semester/Advance sw/Libraries/eclipse/jre/bin;D:\app\AloOoSh\product\11.1.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_18\bin;%ANT_HOME%\bin;%AXIS2_HOME%\bin;%CATALINA_HOME%\bin;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win32;
Dec 20, 2010 8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'
to 'org.eclipse.jst.jee.server:testFirst' did not find a matching property.
Dec 20, 2010 8:32:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 401 ms
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
[INFO] Deploying module: addressing-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testF
irst/WEB-INF/modules/addressing-1.4.mar
[INFO] Deploying module: metadataExchange-1.4 -
file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/mex-1.4.mar
[INFO] Deploying module: ping-1.4 -
file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/ping-1.4.mar
[INFO] Deploying module: script-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/scripting-1.4.mar
[INFO] Deploying module: smtpfault - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/smtpfault.mar
[INFO] Deploying module: soapmonitor-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/soapmonitor-1.4.mar
[INFO] Deploying Web service: Converter - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/Converter/
[INFO] Deploying Web service: version.aar - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/version.aar
Dec 20, 2010 8:32:06 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 20, 2010 8:32:06 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/19 config=null
Dec 20, 2010 8:32:06 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1383 ms
These is my own post to creating webservice and use that service in android. its
work properly.
Try this once below link
http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/#comment-179
The 404 error occurs because there is nothing at the desired url. So there must have been something wrong with your deployment.
Have you set up a server in eclipse and actually published the WS at all? Note that this is different from running Tomcat from a directory somewhere else on your computer! You can add a server instance by selecting New => Server.
If the server configuration is otherwise correct, the server output should appear in eclipse's console, and if anything is wrong with your WS setup, there should be error messages you can use to track down the problem.
You probably extracted the contents of axis2.war (renamed to app.zip) into the wrong folder or deployed files to the wrong folder. Look for the WEB-INF folder directly under the app.war folder that you deployed. If you have another folder of WEB-INF for the axis2 extracted folders, then JBoss cannot locate them. The WEB-INF folder must be a folder as a 1st level descendant. Along with the following folders: axis2-web, META-INF and org.

Tomcat 6 server - was running, but now it won't start - error in log file -SEVERE: Null component?

I've been running Tomcat 6 on my pc for some time now, and it has been running successfully...up until today. I just tried to start it, and now for some reason it won't start.
I start it from a command line prompt. The second prompt that appears after I enter 'startup' in the first prompt is exiting quickly, whereas it usually stays open and shows the status of the server.
Here's what the log file logged -
Dec 3, 2010 4:00:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java\jdk1.5.0_16\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Java\jdk1.5.0_16\bin;C:\jakarta-tomcat\bin;C:\MYSQL\MySQL Server 5.1\bin
Dec 3, 2010 4:00:01 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 3, 2010 4:00:01 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 424 ms
Dec 3, 2010 4:00:01 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 3, 2010 4:00:01 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Dec 3, 2010 4:00:01 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/MyWebApp,J2EEApplication=none,J2EEServer=none
I never saw this before, where it says SEVERE: Null component... - what does it mean? What's causing it?
Here's what I ended up doing. I made a backup of my server.xml and web.xml files, along with my apps under the webapps folder, and removed jakarta-tomcat, and then reinstalled it. I restored the server.xml and web.xml file, threw my webapps back in, and started Tomcat up. This time, I got the same error as before, but it pinpointed that a particular servlet under one of my folders had a "bad version number". So I went through my servlet folders and recompiled the classes.
I started Tomcat again, and its running as it used to.
The problem was that a class had been compiled under a different version of the JDK, and it was causing an error.
Have you changed anything recently with regard to your Tomcat installation, configuration or deployments? Do you have a web application running under Tomcat called "MyWebApp"? If so, I would remove it and see if that fixes the problem. Otherwise, you might have to reinstall Tomcat.

Categories