Can't import a Swagger definition description into WSO2 Publisher - wso2

The Swagger generated definition is automatically generated from my jersey/java project.
The swagger pom.xml conf looks like:
<plugin>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<apiSources>
<apiSource>
<locations>com.rest.resources</locations>
<apiVersion>1.0</apiVersion>
<basePath>http://server:8080/context/api-docs/</basePath>
<swaggerDirectory>${basedir}/src/main/webapp/api-docs/</swaggerDirectory>
<swaggerUIDocBasePath>http://server:8080/context/api-docs/</swaggerUIDocBasePath>
<useOutputFlatStructure>false</useOutputFlatStructure>
</apiSource>
</apiSources>
</configuration>
</plugin>
And the dependency:
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.10</artifactId>
<version>1.3.10</version>
<scope>provided</scope>
</dependency>
The generated files are: services.json + one json file per resource
The service.json looks like:
{
"apiVersion" : "1.0",
"swaggerVersion" : "1.2",
"apis" : [ {
"path" : "/user.{format}",
"description" : "Operations about user"
} ],
"basePath" : "http://server:8080/context/api-docs/"
}
All the generated files are stored in the same directory.
When i try to import the services.json in WSO2 Publisher 1.7 , i get the following error:
org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: Invalid uri 'http://server:8080/context/api-docs/service.json/users.{format}': escaped absolute path not valid (http#194)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:575)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doGet(JaggeryServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
I can access the service.json with the given url to wso2.
Is there something wrong with the generated swagger ?

Related

How to fix ClassCastException when XMLSignatureFactory used in a WSO2-AM Mediator?

I've created a new WSO2 Api Manager Mediator, which'll responsible for filtering Signed SOAP Envelopes. In the request, I receive a tag, which I want to parse with XMLSignatureFactory.
Digital Signature API:
https://www.oracle.com/technetwork/articles/javase/dig-signature-api-140772.html
Input:
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
Id="SIG-1F873A0D2A87BCE8721558280884557279">
<ds:SignedInfo>
...
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
<ds:Reference URI="#id-349F63E22F25E7CF2915581003601374">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>
<ds:DigestValue>..Base64 encoded value...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>..Base64 encoded value...</ds:SignatureValue>
<ds:KeyInfo Id="KI-1F873A0D2A87BCE8721558280884517277">
...
</ds:KeyInfo>
</ds:Signature>
Source code:
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
// Find Signature element.
NodeList nl = doc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");
if (nl.getLength() == 0) {
throw new Exception("Cannot find Signature element");
}
// Create a DOMValidateContext and specify a KeySelector
// and document context.
DOMValidateContext valContext = new DOMValidateContext(cert.getPublicKey(), nl.item(0));
// Unmarshal the XMLSignature.
XMLSignature signature = fac.unmarshalXMLSignature(valContext);
// Validate the XMLSignature.
boolean coreValidity = signature.validate(valContext);
// Check core validation status.
if (coreValidity == false) {
System.err.println("Signature failed core validation");
}
In a standard Java SE program it works fine, but when I use it in a Mediator, I've got the following error:
Exception occured! java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory cannot be cast to javax.xml.crypto.dsig.XMLSignatureFactory
at javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(XMLSignatureFactory.java:202)
at javax.xml.crypto.dsig.XMLSignatureFactory.getInstance(XMLSignatureFactory.java:250)
Maven config:
...
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<bouncycastle.version>1.61</bouncycastle.version>
...
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-core</artifactId>
<version>2.1.7-wso2v80</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
<version>1.2.11.wso2v11</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
...
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<!-- <Export-Package>mediator</Export-Package> -->
<!--<DynamicImport-Package>*</DynamicImport-Package>-->
<Import-Package>
!javax.xml.crypto.*; version="???",
org.apache.xml.security;version="0.0.0",
*
</Import-Package>
</instructions>
</configuration>
</plugin>
I guess this is happening due to package javax.xml.crypto.; version="xxx" exported with wso2 wss4j bundle is conflicting with the default javax.xml.crypto. package exported by the JDK.
In order to overcome this issue, you may pack the mediator as bundle ( OSGI bundle and place it in dropins folder ) and restrict that specific import in the mediator as follows.
Please start the AM in osgiConsole ( with flag -DosgiConsole ) and check the version of the javax.xml.crypto.* package which is being exported by wss4j. Then exclude that specific version from the import section of the mediator.
A sample code is as follows.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Import-Package>
!javax.xml.crypto.*; version="xxx",
org.apache.xml.security;version="0.0.0",
*
</Import-Package>
</instructions>
</configuration>
</plugin>
Thanks

What is the WSO2 ESB message processor method performed after that an element is retrieved from a message store and before the sequence execution?

I am pretty new in WSO2 ESB and I have the following problem trying to create a custom message processor which extends the WSO2 SamplingProcessor class.
The SamplingProcessor class extends the ScheduledMessageProcessor abstract class which in turn implements the MessageProcessor interface (so I think that it should contain the list of all methods that can be implemented by a message processor.
So, to implement my custom message processor, I created a Maven project using this pom.xml file (it should fit the requirement to build a custom message processor):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.toolkit</groupId>
<artifactId>SamplingProcessorHeaderRateLimitation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Sampling Processor Header Rate Limitation</name>
<description>Custom Sampling Mesageprocessor using response header to implement the rate limitation</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.mycompany.toolkit.messageprocessor</Bundle-SymbolicName>
<Bundle-Name>com.mycompany.toolkit.messageprocessor</Bundle-Name>
<Export-Package>com.mycompany.toolkit.*</Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
<Implementation-Build>${buildNumber}</Implementation-Build>
<Scm-Root>${project.scm.connection}</Scm-Root>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<releases>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-core</artifactId>
<version>2.1.7-wso2v3</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<properties>
<CApp.type>lib/synapse/mediator</CApp.type>
</properties>
</project>
Then I created this SamplingProcessorHeaderRateLimitation that is my custom message processor implementation and that extends the SamplingProcessor WSO2 message processor class:
package com.mycompany.toolkit.messageprocessor;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.SynapseException;
import org.apache.synapse.core.SynapseEnvironment;
import org.apache.synapse.message.processor.impl.ScheduledMessageProcessor;
import org.apache.synapse.message.processor.impl.sampler.SamplingProcessor;
import org.apache.synapse.message.processor.impl.sampler.SamplingProcessorView;
public class SamplingProcessorHeaderRateLimitation extends SamplingProcessor {
private static final Log logger = LogFactory.getLog(ScheduledMessageProcessor.class.getName());
private SamplingProcessorView view;
#Override
public void init(SynapseEnvironment se) {
super.init(se);
logger.info("init() START");
System.out.println("init() START");
try {
view = new SamplingProcessorView(this);
} catch (Exception e) {
throw new SynapseException(e);
}
// register MBean
org.apache.synapse.commons.jmx.MBeanRegistrar.getInstance().registerMBean(view,
"Message Sampling Processor view", getName());
logger.info("init() END");
System.out.println("init() END");
}
#Override
public void setParameters(Map<String, Object> parameters) {
logger.info("setParameters() START");
System.out.println("setParameters() START");
// TODO Auto-generated method stub
super.setParameters(parameters);
logger.info("setParameters() END");
System.out.println("setParameters() END");
}
}
Finnally I am using my custom SamplingProcessorHeaderRateLimitation class into the ESB message processor definition (instead of the standard SamplingProcessor):
<?xml version="1.0" encoding="UTF-8"?>
<!---<messageProcessor class="org.apache.synapse.message.processor.impl.sampler.SamplingProcessor" messageStore="transferFromMessageStore" name="transferFromMessageProcessor" xmlns="http://ws.apache.org/ns/synapse">-->
<messageProcessor class="com.mycompany.toolkit.messageprocessor.SamplingProcessorHeaderRateLimitation" messageStore="transferFromMessageStore" name="transferFromMessageProcessor" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="sequence">transferProcessorSequence</parameter>
<parameter name="interval">1000</parameter>
<parameter name="is.active">true</parameter>
<parameter name="concurrency">1</parameter>
</messageProcessor>
This message processor perform the transferProcessorSequence.xml sequence for each element retrieved from the transferFromMessageStore message store.
It works fine but as you can see I put some logger.info() into the init() and setParameters() methods of my custom implementation. It works fine but these method are performed only once when the message processor is initialized.
I need to know what is the method that is performed each time that an element is retrieved from the transferFromMessageStore message store because here I have to implement a custom operation.
So, what is the method performed after that an element is retrieved from the message store related to a message processor and before the execution of the related sequence? (it is very important to me know the method after the retrieving of the element and before the sequence execution)
Inorder to do custom implementation between every message consumption and dispatch to the sequence, need to extend the class SamplingService. org.apache.synapse.message.processor.impl.sampler.SamplingService.java
Because its the org.apache.synapse.task.Taskassociated with SamplingService Processor.
Need to override either execute() or fetch(MessageConsumer msgConsumer) method in SamplingService. preferably fetch method. Also have a look at dispatch() method of the service.
public MessageContext fetch(MessageConsumer msgConsumer) {
MessageContext newMsg = super.fetch(msgConsumer);
// custom code here
return newMsg;
}
Use https://github.com Luke
MessageProcessor code on github
important lines are:
boolean setMessageConsumer(MessageConsumer messageConsumer);
List<MessageConsumer> getMessageConsumer();
Documentation of method setMessageConsumer, clearly states.
/**
* This method is used to set the message consumer of message processor. Consumer is the one who is
* responsible for retrieving messages from a store.
* #param messageConsumer is the name of the associated message consumer
* #return is true if the message if the message consumer is returned successfully. Otherwise false.
*/
Since storing and consuming messages from store are opposite operation, then all those java classes should be next to each other. All you need, must be around same folder.

Using wsgen and #Interceptors causes --> Unsupported major.minor version 51.0

I have a Java EE project packaged on an ear. The ear contains one Jar where i package my #stateless EJBs and other not managed classes (my model, utils etc). For some of these EJBs i use Jax-Ws to expose their functionality as a web-service.
I try to create a logging mechanism using AOP, so i place the #Interceptors annotation in my Jax-Ws powered EJBs. The problem is that when i try to compile/build/package using maven i receive the following exception. It seems the problem is specific to wsgen cause when i put the #Interceptors annotation in the NON Jax-ws annotated EJBs it compiles and runs without any problem. I use JAva build 1.6.0_41-b02.
I also tried to find an older version of javax.interceptor-api (probably compiled in Java 1.6, as major.minor version 51.0 means that it has been compiled in JSE 7, if i get it right) but seems that 1.2 is the older one.
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:wsgen (MyWebService) on pro
ect my-ws-ejb: Failed to execute wsgen: javax/interceptor/Interceptors : Unsupported major.minor version 51.0 -> [Help
1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plu
in:2.2:wsgen (MyWebService) on project my-ws-ejb: Failed to execute wsgen
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to execute wsgen
at org.jvnet.jax_ws_commons.jaxws.AbstractWsGenMojo.execute(AbstractWsGenMojo.java:148)
at org.jvnet.jax_ws_commons.jaxws.MainWsGenMojo.execute(MainWsGenMojo.java:95)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.UnsupportedClassVersionError: javax/interceptor/Interceptors : Unsupported major.minor version 51.
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:181)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3079)
at java.lang.Class.getAnnotation(Class.java:3038)
at com.sun.tools.ws.wscompile.WsgenOptions.validateEndpointClass(WsgenOptions.java:240)
at com.sun.tools.ws.wscompile.WsgenOptions.validate(WsgenOptions.java:222)
at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:123)
at com.sun.tools.ws.WsGen.doMain(WsGen.java:74)
at org.jvnet.jax_ws_commons.jaxws.AbstractWsGenMojo.execute(AbstractWsGenMojo.java:142)
... 22 more
My pom (part):
<build>
<!-- The name of the jar file -->
<finalName>my-ws-ejb</finalName>
<plugins>
<!-- Use EJB 3.0 -->
<plugin>
<groupId>org.apache.maven.plugins
</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<!-- The WSDLs to be generated are placed here -->
<execution>
<id>MyWebService</id>
<configuration>
<sei>MyWebServiceBean</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
<verbose>true</verbose>
</configuration>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<!-- Build with Java 6 -->
<source>1.6</source>
<target>1.6</target>
<!-- Show deprecations and warnings -->
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- EJB 3 -->
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- EclipseLink -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence</artifactId>
<version>1.0.0.0_2-0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>persistence</artifactId>
<version>1.0.0.0_2-0</version>
<scope>provided</scope>
</dependency>
<!-- Oracle JDBC driver -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
<scope>provided</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>1.2</version>
</dependency>
.....
</dependencies>
My Bean (part)
#Interceptors(LoggingAopService.class)
#WebService(
serviceName = "MyWebService", portName = "MyWebService",
targetNamespace = "..."
)
#Stateless(name = "MyWebServiceBean", mappedName = "ejb/seb/MyWebServiceBean")
public class MyWebServiceBean implements MyWebService
{....}
Are you try web-beans.xml instead annotation? if didn't please check this is link. May be the maven plugin don't recognize this annotation.
The class level declaration should be look like this code:
<myapp:MyWebServiceBean>
<myfwk:LoggingAopService/>
</myapp:MyWebServiceBean>
And this interceptor need to enabled:
<Interceptors>
<myfwk:LoggingAopService/>
</Interceptors>
I didn't test these codes.
web-beans.xml declaration you sent is jboss specific ? I use web logic and found that an interceptor can be enabled by the following xml added in the META-INF/beans.xml.
<interceptors>
<class>org.samples.LoggingInterceptor</class>
</interceptors>
I will try the xml declaration but because i was in a hurry i leveraged Handler capabilities provided natively by the Jax-Ws framework (using #HandlerChain annotation) to "intercept" web service requests and responses.
I also tried to create a new annotation using the #InterceptorBinding way:
#Inherited
#InterceptorBinding
#Retention(RUNTIME)
#Target({ METHOD, TYPE })
public #interface Logging {
}
#Interceptor
#Logging
public class LoggingInterceptor {
#AroundInvoke
public Object intercept(InvocationContext context) throws Exception {...}
#Logging
#WebService(serviceName = "MyWebService", portName = "MyWebService",
targetNamespace = "...")
#Stateless(name = "MyWebServiceBean", mappedName = "ejb/seb/MyWebServiceBean")
public class MyWebServiceBean implements MyWebService
{....}
but this does not compile too, i receive the same error:
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:w
sgen (EDocWebService) on project eDoc-ws-ejb: Failed to execute wsgen: javax/int
erceptor/InterceptorBinding : Unsupported major.minor version 51.0 -> [Help 1]
Probably this is a case where ejb-jar.xml should be used
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<interceptors>
<interceptor>
<interceptor-class>com.mypackage.LoggingInterceptor </interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>MyWebServiceBean</ejb-name>
<interceptor-class>com.package.Interceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>

Configuring context path for jetty with static resources

I have a maven application configured to start Jetty and also load statics from ../client . Configuration is below:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.4.v20120524</version>
<configuration>
<scanIntervalSeconds>25</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
<port>9095</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppSourceDirectory>../client/</webAppSourceDirectory>
<webAppConfig>
<resourceBases>
<resourceBase>src/main/webapp</resourceBase>
<resourceBase>../client/</resourceBase>
</resourceBases>
</webAppConfig>
</configuration>
</plugin>
What I am trying to do is to move only webapp under /API resource base. To be more explicit I want to have the mappings:
src/main/webapp ---> /API
../client/ ---> /
Finally found the right config:
<webAppConfig>
<contextPath>/API</contextPath>
</webAppConfig>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<contextPath>/</contextPath>
<resourceBase>../client/</resourceBase>
</contextHandler>
</contextHandlers>

Jetty 8 server not able to find org.springframework.web.servlet.tags package

I am trying to deploy an app which has a jsp with the spring form tld on my Jetty hightide 8.1.0.RC1 server but when I try to load the jsp i get an error complaining: package org.springframework.web.servlet.tags does not exist.
I have verified that it exists in my war file. Has anyone seen this issue before?
My jsp has the following includes:
<%# taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%# taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
In my pom file i have:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>com.springsource.org.apache.taglibs.standard</artifactId>
<version>1.1.2</version>
</dependency>
Here is the full stack trace of the exception:
PWC6199: Generated servlet error:
string:///genericDash_jsp.java:210: package org.springframework.web.servlet.tags does not exist
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:129)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:299)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:392)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:575)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1061)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:995)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:271)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1157)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:927)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:575)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1366)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:483)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1061)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:995)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:431)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:911)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:870)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:238)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:68)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:680)
I was able to resolve this by setting the systemproperty
"-Dorg.apache.jasper.compiler.disablejsr199=true" in the start.ini file of jetty server config.
Check out this link for details:
http://wiki.eclipse.org/Jetty/Howto/Configure_JSP#Compiling_JSPs