I'm using sonar 3.4.1, I've done jdbc configuration on sonar.properties, but when I want to start the server, I'm having this error :
| 2013-10-07 15:30:24.061:INFO::Logging to org.sonar.application.FilteredLogger#4ee1d5ea via org.sonar.application.FilteredLogger
| 2013-10-07 15:30:24.146:INFO::jetty-6.1.25
| 2013-10-07 15:30:24.448:INFO::NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
| JRuby limited openssl loaded. http://jruby.org/openssl
| gem install jruby-openssl for full support.
| 2013-10-07 15:30:45.912:INFO::Started SelectChannelConnector#0.0.0.0:9000
In the sonar log i have this exception :
2013.10.07 14:21:23 ERROR o.s.c.p.Database Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429) ~[commons-dbcp-1.3.jar:1.3]
at
Related
I have an existing application deployed to Apache Karaf OSGi container.
The application bundles implement SOAP and REST web services using Apache CXF, configured by blueprint.xml files that look like this:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0 http://aries.apache.org/schemas/blueprint-ext/blueprint-ext.xsd">
<jaxws:endpoint id="bundle1-server" implementor="com.myapp.Bundle1ServiceImpl" endpointName="s:Bundle1Port"
serviceName="s:Bundle1Service" address="http://0.0.0.0:9080/SoapContext/Bundle1Port" wsdlLocation="wsdl/Bundle1Service.wsdl" xmlns:s="http://com.myapp/services/bundle1service">
</jaxws:endpoint>
</blueprint>
When the endpoint starts, I can see this in the log:
INFO | org.apache.cxf.endpoint.ServerImpl | | org.apache.cxf.endpoint.ServerImpl - initDestination - 85 | 109 - org.apache.cxf.cxf-core - 3.1.9 | Setting the server's publish address to be http://0.0.0.0:9080/SoapContext/Bundle1Port
INFO | org.eclipse.jetty.server.ServerConnector | | org.eclipse.jetty.server.AbstractConnector - doStart - 266 | 204 - org.eclipse.jetty.util - 9.2.15.v20160210 | Started ServerConnector#30394ac6{HTTP/1.1}{0.0.0.0:9080}
The CXF uses Jetty to receive the incoming HTTP requests (there is a cxf-rt-transports-http-jetty dependency in the pom.xml).
I want to switch the web services from http to https.
When I change the port number in the blueprint.xml, the web service is indeed reachable at the new port.
However, changing the URL scheme from http to https (http://:9080 to https://:9443) results in an error:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean bundle1-server
...
Caused by: java.io.IOException: Protocol mismatch for port 9443: engine's protocol is http, the url protocol is https
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:277)
Obviously, I also need to specify the server certificate and the CA certificate. I have tried to add the following:
<httpj:engine-factory bus="cxf">
<httpj:engine port="9443">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="changeit">
<sec:keyStore type="JKS" password="changeit"
file="/path-to-certificates/keystore.ks"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore type="JKS" password="password"
file="/path-to-certificates/truststore.ks"/>
</sec:trustManagers>
<sec:clientAuthentication want="false" required="false"/>
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
But now I get:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to load class org.eclipse.jetty.server.Connector from recipe MapRecipe[name='#recipe-85']
...
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector not found by Bundle1 [255]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.4.0.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)[:1.8.0_262]
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1925)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:467)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintRepository.loadClass(BlueprintRepository.java:419)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:135)[13:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:168)[13:org.apache.aries.blueprint.core:1.6.1]
What am I missing here?
Update: I also tried to configure SSL globally for the whole Karaf server by editing etc/org.ops4j.pax.web.cfg to include
org.osgi.service.http.secure.enabled=true
org.ops4j.pax.web.ssl.keystore=/path-to-keystore.ks
org.ops4j.pax.web.ssl.password=changeit
org.ops4j.pax.web.ssl.keypassword=changeit
org.osgi.service.http.port.secure=8443
Then I can see in the logs
INFO | org.ops4j.pax.web.service.jetty.internal.JettyServerImpl | | org.ops4j.pax.web.service.jetty.internal.JettyServerImpl - addConnector - 226 | 222 - org.ops4j.pax.web.pax-web-jetty - 4.2.6 | Pax Web available at [0.0.0.0]:[8443]
INFO | org.eclipse.jetty.server.ServerConnector | | org.eclipse.jetty.server.AbstractConnector - doStart - 266 | 204 - org.eclipse.jetty.util - 9.2.15.v20160210 | Started secureDefault#3bae4ef2{SSL-http/1.1}{0.0.0.0:8443}
..
Caused by: java.io.IOException: Protocol mismatch for port 8443: engine's protocol is http, the url protocol is https
Which is really confusing...
I have fixed the ClassNotFoundException by adding org.eclipse.jetty.server to Import-Package in META-INF/MANIFEST.MF
However, I have read this: "I strongly discourage people from configuring the jetty servers in their blueprint files" http://servicemix.396122.n5.nabble.com/servicemix-5-4-0-cxf-jetty-blueprint-issue-td5722268.html
So maybe I should still try to fix the latter (global) config if possible.
I'm trying to run Apache Drill on Windows 7, I have the requirements provided in the documentation and yet when I run it in terminal I get this error :
Error: Failure in starting embedded Drillbit: java.lang.RuntimeException: Unable to deserialize "/tmp/drill/sys.storage_plugins/dfs.sys.drill" (state=,code=0)
java.sql.SQLException: Failure in starting embedded Drillbit: java.lang.RuntimeException: Unable to deserialize "/tmp/drill/sys.storage_plugins/dfs.sys.drill"
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:109)
at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:66)
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
at org.apache.drill.jdbc.Driver.connect(Driver.java:78)
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)
at sqlline.Commands.connect(Commands.java:1083)
at sqlline.Commands.connect(Commands.java:1015)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
at sqlline.SqlLine.dispatch(SqlLine.java:734)
at sqlline.SqlLine.initArgs(SqlLine.java:519)
at sqlline.SqlLine.begin(SqlLine.java:587)
at sqlline.SqlLine.start(SqlLine.java:366)
at sqlline.SqlLine.main(SqlLine.java:259)
Caused by: java.lang.RuntimeException: Unable to deserialize "/tmp/drill/sys.storage_plugins/dfs.sys.drill"
at org.apache.drill.exec.store.sys.local.FilePStore.get(FilePStore.java:140)
at org.apache.drill.exec.store.sys.local.FilePStore$Iter$DeferredEntry.getValue(FilePStore.java:219)
at org.apache.drill.exec.store.StoragePluginRegistry.createPlugins(StoragePluginRegistry.java:168)
at org.apache.drill.exec.store.StoragePluginRegistry.init(StoragePluginRegistry.java:132)
at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:244)
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:100)
... 18 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: [B#6c8d3583; line: 1, column: 1]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:1351)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1252)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:912)
at org.apache.drill.exec.store.sys.serialize.JacksonSerializer.deserialize(JacksonSerializer.java:44)
at org.apache.drill.exec.store.sys.local.FilePStore.get(FilePStore.java:138)
... 23 more
when I go to tmp folder I find only one file
Does anyone know how to fix this ?
Thank you
delete/move the folder /tmp/drill/sys.storage_plugins & restart the drill. It'll create the folder while starting the drill & now find the issue by comparing old & new.
It worked for me.
Thank you guys,
It worked when I replaced the /tmp/drill/sys.storage_plugins with the files created in the same location from an other computer, I still don't know why this one can't create all of them but at least now it works !
It's 2018 03 02, and this error is STILL appearing for people (like me) trying to install & run Apache Drill in Embedded Mode on Windows 10...
HERE'S WHAT WORKED FOR ME: INSTALL Drill only to
C:\apache-drill-1.12.0*
NOTE that this creates a
C:\tmp\sys.storage_plugins\ directory RATHER than DELETE this directory, I simply MOVED this directory temporarily to my laptop's desktop;
THEN I restarted the Drill Shell as follows...
LAUNCH a common Windows 10 cmd console
cd to C:\apache-drill-1.12.0\bin\ EXECUTE this command:
sqlline sqlline.bat -u "jdbc:drill:zk=local;schema=dfs"
RESULT: I get the following (WONDERFUL) initialization output:
DRILL_ARGS - " sqlline.bat -u jdbc:drill:zk=local;schema=dfs" Calculating HADOOP_CLASSPATH ... HBASE_HOME not detected... Calculating Drill classpath... Picked up _JAVA_OPTIONS: -Xmx512M
-Xms512M Mar 02, 2018 8:36:33 PM org.glassfish.jersey.server.ApplicationHandler initialize INFO: Initiating Jersey application, version Jersey: 2.8 2014-04-29 01:25:26... Property "url" is required apache drill 1.12.0 "what ever the mind of man can conceive and believe, drill can query"
0: jdbc:drill:zk=local>
FROM here I issued the "SHOW DATABASES;" command... and it WORKED !
0: jdbc:drill:zk=local> SHOW DATABASES;
+---------------------+ | SCHEMA_NAME |
+---------------------+ | INFORMATION_SCHEMA | | cp.default | | dfs.default | | dfs.root | | dfs.tmp | | sys |
+---------------------+ 6 rows selected (5.797 seconds)
0: jdbc:drill:zk=local>
I am still new in Play! Framework universe I i'd like to ask you folk a question. I am trying to connect Oracle to my application. Thus, I added this in the application.conf file:
db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.url="jdbc:oracle:thin:#localhost:1521/test"
db.default.user=scott
db.default.password="tiger"
And of course added the dependenies... But it still not working and throws me a beautiful exception :
"Configuration error : Cannot connect to database [default]"
Am I wrong in something ? Please I really need help.
Thanks.
#
#Frank Schmitt : nope I didn't tried this.
#wwkudu : by running my application, I get this :
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sle
eping for 0ms and trying again. Attempts left: 0. Exception: null
[error] application -
! #6h70iggbo - Internal server error, for (GET) [/] ->
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [
default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configura
tion.scala:81) ~[play_2.10.jar:2.1.5]
at play.api.Configuration.reportError(Configuration.scala:559) ~[play_2.
10.jar:2.1.5]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:251) ~[pla
y-jdbc_2.10.jar:2.1.5]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:242) ~[pla
y-jdbc_2.10.jar:2.1.5]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
Caused by: java.sql.SQLException: Exception d'E/S: Got minus one from a read cal
l
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:112) ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:146) ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:255) ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) ~[ojdb
c14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
414) ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165) ~[ojd
bc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
Check if the Database named test exists
I am working with my colleagues on our first Grails web app project. From the begining I am struggling with some strange issue. I am using Spring Tool Suite, Java JDK 1.7.0_45 and grails 2.2.4.
I simply import existing project to STS and then Run-As -> Grails Command (run-app) and I got this error instead of working app(my colleagues doesnt have this error but use the same existing project):
| Loading Grails 2.2.4
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
| Error 2013-11-18 12:03:39,505 [localhost-startStop-1] ERROR core.StandardContext - Error initializing resources: The alias mapping '/plugins/famfamfam-1.0.1=C:\Users\Sebastian\(some path)\ProjectName\target\plugins\famfamfam-1.0.1\.\web-app' is not valid
| Error 2013-11-18 12:03:39,585 [localhost-startStop-1] ERROR core.StandardContext - Error getConfigured
| Error 2013-11-18 12:03:39,586 [localhost-startStop-1] ERROR core.StandardContext - Context [/ProjectName] startup failed due to previous errors
| Server running. Browse to http://localhost:8080/ProjectName
Looking forward for any help!
I've installed Sonar on an Ubuntu host using 'apt-get install sonar'. Since this is just a demo instance of Sonar for me to play with, I'm using the embedded H2 database.
Sonar seems to start up fine, and I don't have any errors or warnings in my sonar.log. However, when I try to hit it through my web browser, I get the ol' "Oops! Google Chrome could not connect to... blahblahblah".
The host is actually an EC2 instance - not sure if that makes a difference. It has the private IP assigned by Amazon, a URL (ie, ec2-xx-xx...amazonaws.com), and a vanity URL so I don't have to remember that monstrous underlying URL.
Right now, Sonar's properties looks like this. (I've intentionally X'd out the IP address where-ever it appears.)
sonar.web.host: 10.xxx.xx.xxx
sonar.web.port: 9000
sonar.web.context: /
...
sonar.jdbc.url: jdbc:h2:tcp://10.xxx.xx.xxx:9092/sonar
sonar.jdbc.driverClassName: org.h2.Driver
sonar.embeddedDatabase.port: 9092
And I'm unable to access it by pointing my browser to ${monstrous_URL}:9000 or ${vanity URL}:9000. I've also tried setting sonar.web.host to 0.0.0.0, and to ${monstrous_URL} - both to no avail, sadly.
For reference, this is what my sonar.log looks like:
STATUS | wrapper | 2013/03/13 20:21:42 | --> Wrapper Started as Daemon
STATUS | wrapper | 2013/03/13 20:21:43 | Launching a JVM...
INFO | jvm 1 | 2013/03/13 20:21:43 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2013/03/13 20:21:43 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 1 | 2013/03/13 20:21:43 |
INFO | jvm 1 | 2013/03/13 20:21:43 | 2013-03-13 20:21:43.422:INFO::Logging to org.sonar.application.FilteredLogger#7dc6a657 via org.sonar.application.FilteredLogger
INFO | jvm 1 | 2013/03/13 20:21:43 | 2013-03-13 20:21:43.484:INFO::jetty-6.1.25
INFO | jvm 1 | 2013/03/13 20:21:43 | 2013-03-13 20:21:43.756:INFO::NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
2013.03.13 20:21:44 INFO o.s.s.p.ServerImpl Sonar Server / 3.4.1 / 2f6a7f38e57ec8e9a7bedc81b3260ae735d2a8c8
2013.03.13 20:21:45 INFO o.s.s.d.EmbeddedDatabase Starting embedded database on port 9092 with url jdbc:h2:tcp://10.xxx.xx.xxx:9092/sonar
2013.03.13 20:21:45 INFO o.s.s.d.EmbeddedDatabase Embedded database started. Data stored in: /opt/sonar/data
2013.03.13 20:21:45 WARN o.s.c.p.DefaultDatabase H2 database should be used for evaluation purpose only
2013.03.13 20:21:45 INFO o.s.c.p.Database Create JDBC datasource for jdbc:h2:tcp://10.xxx.xx.xxx:9092/sonar
2013.03.13 20:21:47 INFO o.s.s.p.DefaultServerFileSystem Sonar home: /opt/sonar
2013.03.13 20:21:47 INFO o.s.s.p.DefaultServerFileSystem Deploy dir: /opt/sonar/war/sonar-server/deploy
2013.03.13 20:21:47 INFO org.sonar.INFO Install plugins...
2013.03.13 20:21:47 INFO o.s.s.p.PluginDeployer Deploy plugin Findbugs / 1.1 / 4785d335df6bd0e662d636a6fb03d79fbdda8c5a
2013.03.13 20:21:47 INFO o.s.s.p.PluginDeployer Deploy plugin JaCoCo / 1.1 / 4785d335df6bd0e662d636a6fb03d79fbdda8c5a
Does anyone have experience running Sonar on an EC2 instance, or have any tips for me? I'm stumped!
And I'm unable to access it by pointing my browser to ${monstrous_URL}:9000 or ${vanity URL}:9000.
Change the security group attached to the EC2 instance to allow incoming connections to TCP port 9000.
change H2 database to mysql with following enteries as
sonar.
jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.jdbc.driverClassName= com.mysql.jdbc.Driver
sonar.jdbc.validationQuery= select 1
and also make following changes in sonar.properties :
sonar.web.host: 0.0.0.0
sonar.web.context: /sonar