Skip to content

Instantly share code, notes, and snippets.

View dlinsin's full-sized avatar

David Linsin dlinsin

View GitHub Profile
@dlinsin
dlinsin / gist:190831
Created September 22, 2009 05:17
Spring DM WebExtender Exception
17.09.2009 09:08:23 org.springframework.osgi.web.deployer.tomcat.TomcatWarDeployer afterPropertiesSet
SEVERE: No Catalina Service found, bailing out
org.springframework.osgi.service.ServiceUnavailableException: service matching filter=[(objectClass=org.apache.catalina.Service)] unavailable
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:395)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.afterPropertiesSet(ServiceDynamicInterceptor.java:455)
at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.createProxy(OsgiServiceProxyFactoryBean.java:185)
at org.springframework.osgi.service.importer.support.AbstractServiceImporterProxyFactoryBean.getObject(AbstractServiceImporterProxyFactoryBean.java:86)
at org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean.getObject(OsgiServiceProxyFactoryBean.java:137)
at org.springframework.osgi.we
@At("/guestbook")
public class Guestbook {
private List<Entry> entries;
private Entry newEntry = new Entry();
@Inject
private EntryDao entryDao;
public List<Entry> getEntries() {
return entries;
<body>
@Repeat(items=entries, var="entry")
<p><a href="/guestbook/${entry.id}">${entry.id} on ${entry.date}</a></p>
<form action="/guestbook" method="post">
Name: <input name="newEntry.name" type="text"/><br/>
Text: <input name="newEntry.text" type="text"/>
<input type="submit" value="save" name="save"/>
</form>
</body>
<bean id="beanToBeExported" scope="bundle" class="com.xyz.MessageServiceImpl"/>
import org.springframework.osgi.extensions.annotation.ServiceReference;
public class MyService {
private LogService logService;
@ServiceReference(cardinality=ServiceReferenceCardinality.C0__1)
public void setLogService(LogService argLogService) {
logService= argLogService;
}
// other stuf
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean class="org.springframework.osgi.extensions.annotation.ServiceReferenceInjectionBeanPostProcessor"/>
<bean id="testService" class="de.linsin.sample.springdm.MyService"/>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<util:properties id="extenderProperties"> <prop key="process.annotations">true</prop> </util:properties>
</beans>
public class Bot extends PircBot {
private boolean silentMode = false;
private Collection<NotificationService> notificationServices;
private Collection<String> messages;
private Timer messagesTimer;
static final int MESSAGE_BATCH_SIZE = 20;
static final int MESSAGE_BATCH_DELAY_MS = 60000;
@Override
public class AppNotificationService implements NotificationService {
private final String credentials;
public static final String USER_CREDENTIALS = "user_credentials";
public static final String NOTIFICATION_LONG_MESSAGE = "notification[long_message]";
public static final String NOTIFICATION_TITLE = "notification[title]";
public static final String MESSAGE_LEVEL = "message_level";
public static final String URL = "https://www.appnotifications.com/account/notifications.xml";
public static final String HTTP_USERAGENT = "http.useragent";
public AppNotificationService(String argCredentials) {
package de.linsin.sample.tools.bug;
import com.sun.tools.attach.VirtualMachine;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class ToolsJarTest {
@Test
public void testJVMInstances() {
assertTrue(VirtualMachine.list().size() > 0);