Skip to content

Instantly share code, notes, and snippets.

View cschneider's full-sized avatar
🏠
Working from home

Christian Schneider cschneider

🏠
Working from home
View GitHub Profile
@cschneider
cschneider / DbLockManager.java
Created November 3, 2011 15:46
DBLockManager
package org.talend.example;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@cschneider
cschneider / camel-context.xml
Created November 3, 2011 15:59
Spring context for lock
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
@cschneider
cschneider / gist:1540146
Created December 30, 2011 14:40
Karaf log
2011-12-30 15:38:41,328 | DEBUG | l Console Thread | Connection | .pax.url.mvn.internal.Connection 145 | 2 - org.ops4j.pax.url.mvn - 1.2.8 | Resolving [mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features]
2011-12-30 15:38:41,329 | DEBUG | l Console Thread | Connection | .pax.url.mvn.internal.Connection 260 | 2 - org.ops4j.pax.url.mvn - 1.2.8 | Collecting versions from repository [file:C:/java/apache-karaf-2.2.5/system/,releases=true,snapshots=true]
2011-12-30 15:38:41,329 | DEBUG | l Console Thread | Connection | .pax.url.mvn.internal.Connection 378 | 2 - org.ops4j.pax.url.mvn - 1.2.8 | Resolving exact version
2011-12-30 15:38:41,329 | DEBUG | l Console Thread | Connection | .pax.url.mvn.internal.Connection 260 | 2 - org.ops4j.pax.url.mvn - 1.2.8 | Collecting versions from repository [file:C:/java/apache-karaf-2.2.5/local-repo/,releases=true,snapshots=true]
2011-12-30 15:38:41,330 | DEBUG | l Console Thread |
@cschneider
cschneider / gist:1594334
Created January 11, 2012 11:51
blueprint with two instances of DbSelect
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="eager">
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
<command name="db/query">
<action class="net.lr.tutorial.karaf.db.command.QueryCommand">
<property name="dbAccess" ref="dbAccess" />
</action>
</command>
<command name="db/exec">
<action class="net.lr.tutorial.karaf.db.command.ExecuteCommand">
@cschneider
cschneider / cxfinstall
Created January 16, 2012 16:06
CXF with separate bundles
features:addurl mvn:org.apache.cxf.karaf/apache-cxf/2.6.0-SNAPSHOT/xml/features
features:install cxf-specs
feature:install war
install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.1.1_1
install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/2.2.1.1_1
install -s mvn:org.codehaus.woodstox/stax2-api/3.1.1
install -s mvn:org.codehaus.woodstox/woodstox-core-asl/4.1.1
install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.wsdl4j/1.6.2_3
Index: src/main/java/org/apache/cxf/transport/http/policy/PolicyDataEngine.java
===================================================================
--- src/main/java/org/apache/cxf/transport/http/policy/PolicyDataEngine.java (revision 0)
+++ src/main/java/org/apache/cxf/transport/http/policy/PolicyDataEngine.java (revision 0)
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
@cschneider
cschneider / gist:2377258
Created April 13, 2012 14:27
pax.url.mvn.cfg
################################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
2012-07-20 14:55:19,972 | WARN | jms.model.Person | TransactionErrorHandler | 66 - org.apache.camel.camel-core - 2.9.2 | Transaction rollback (0x1a587d8) redelivered(unknown) for (MessageId: ID-sopwin58-58523-1342714676067-6-25837 on ExchangeId: ID-sopwin58-58523-1342714676067-6-25838) caught: java.lang.RuntimeException: Exception to check if transactions and redelivery work
2012-07-20 14:55:19,972 | WARN | jms.model.Person | JpaConsumer | 110 - org.apache.camel.camel-jpa - 2.9.2 | Error processing last message due: org.apache.camel.RuntimeCamelException: java.lang.RuntimeException: Exception to check if transactions and redelivery work. Will commit all previous successful processed message, and ignore this last failure.
javax.persistence.PersistenceException: org.apache.camel.RuntimeCamelException: java.lang.RuntimeException: Exception to check if transactions and redelivery work
at org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:108)[110:org.apache.came
@cschneider
cschneider / FeatureServiceImpl.patch
Created September 21, 2012 12:39
Make FrameWorkListener local to refreshPackages
Index: src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
===================================================================
--- src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java (revision 1387939)
+++ src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java (working copy)
@@ -98,7 +98,7 @@
* create dummy sub shells. When invoked, these commands will prompt the user for
* installing the needed bundles.
*/
-public class FeaturesServiceImpl implements FeaturesService, FrameworkListener {
+public class FeaturesServiceImpl implements FeaturesService {