Skip to content

Instantly share code, notes, and snippets.

View johnament's full-sized avatar

John Ament johnament

View GitHub Profile
@johnament
johnament / HelloServletClientTest.java
Created November 14, 2012 17:00
Arquillian error - deployment failure
@RunWith(Arquillian.class)
public class HelloServletClientTest {
@Deployment(testable=false)
public static WebArchive createTestArchive() {
WebArchive wa = ShrinkWrap.create(WebArchive.class,"test.war")
.addClass(HelloServlet.class)
.addAsWebInfResource("web.xml");
return wa;
}
----------------------------
ID: 1
Address: http://SSI11021:8082/ee-api-activity/ActivityImporterExporterWebService
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], connection=[Keep-Alive], Content-Length=[1230], content-type=[text/xml;charset=UTF-8], host=[SSI11021:8082], SOAPAction=[""], user-ag
ent=[Apache-HttpClient/4.1.1 (java 1.5)]}
Payload: <soapenv:Envelope xmlns:apis="http://apis.activity.ee.mycompany.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://d
package com.mycompany.services.jaas;
import javax.ejb.Stateless;
import javax.jws.WebService;
import org.apache.cxf.interceptor.InInterceptors;
import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.ws.api.annotation.EndpointConfig;
/**
@Produces
@TWSClientOptions
public TWSClientConfiguration findAppropriate(final InjectionPoint ip) {
final Set<Annotation> qualifiers = ip.getQualifiers();
TWSClientOptions tco = null;
for (final Annotation a : qualifiers) {
if (a.annotationType() == TWSClientOptions.class) {
tco = (TWSClientOptions) a;
break;
}
@Deployment(name = "war2", testable = false)
public static WebArchive createDep2() {
return ShrinkWrap
.create(WebArchive.class, "application2.war")
.addClasses(CountryBean.class, CountryBeanLocal.class,
CountryEAO.class, CountryEAOLocal.class, Country.class,
SystemPropertyBeanLocal.class,
SystemPropertyBean.class, SearchUtilLocal.class,
SearchUtil.class, DozerBeanMapperServiceLocal.class,
DozerBeanMapperService.class,
java.lang.NullPointerException
at org.mvel2.DataConversion.convert(DataConversion.java:129)
at org.mvel2.conversion.ArrayHandler.handleLooseTypeConversion(ArrayHandler.java:80)
at org.mvel2.conversion.ArrayHandler.convertFrom(ArrayHandler.java:39)
at org.mvel2.DataConversion.convert(DataConversion.java:129)
at org.jboss.forge.shell.command.Execution.perform(Execution.java:95)
at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:109)
at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)
at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:818)
at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:841)
@johnament
johnament / forge.txt
Created February 18, 2013 13:52
forge update error
[no project] john.ament $ forge update
forge update
***INFO*** This Forge installation will be updated to 1.2.1.Final
? Is that ok ? [Y/n]
Update in progress. Please wait... \
***SUCCESS*** Forge?will now restart?to complete the update...
_____
| ___|__ _ __ __ _ ___
| |_ / _ \| `__/ _` |/ _ \ \\
Maven.resolver().offline().loadPomFromFile("pom.xml").resolve("com.mycompany:foo-app").withTransitivity().asSingle(WebArchive.class);
@johnament
johnament / EditPD.java
Created March 18, 2013 17:26
ShrinkWrap can be ugly
public static void updatePersistence(final PersistenceDescriptor pd) {
for (final PersistenceUnit<PersistenceDescriptor> pu : pd.getAllPersistenceUnit()) {
Property<Properties<PersistenceUnit<PersistenceDescriptor>>> hbm2ddl = null;
for (final Property<Properties<PersistenceUnit<PersistenceDescriptor>>> prop : pu.getOrCreateProperties()
.getAllProperty()) {
if (prop.getName().equals("hibernate.hbm2ddl.auto")) {
hbm2ddl = prop;
break;
}
}