-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AS2ReceiveServlet startup issue #36
Comments
Hi, thanks for pointing that out. |
Thanks Philip, that would be great! Appreciated! NOTE: I did HACK a fix for this issue by adding a static initializer in the AS2ReceiveServlet class:
The NEXT ISSUE I encountered (after fixing the previous one) was "java.lang.IllegalStateException: No servlet context path present!" (full stack trace below). Any idea how to fix this? Question: Did you actually get this AS2 servlet working in an EE container? Could you perhaps provide a working example? This would be VERY useful code if we can get it working! FULL STACK TRACE:
|
I created a new filter to be used instead of your static block (requires version 4.0.3-SNAPSHOT of course). It was tested with the following minimum <web-app
xmlns="http://java.sun.com/xml/ns/javaee"
version="3.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
metadata-complete="true">
<listener>
<listener-class>com.helger.as2servlet.AS2WebAppListener</listener-class>
</listener>
<servlet>
<servlet-name>AS2ReceiveServlet</servlet-name>
<servlet-class>com.helger.as2servlet.AS2ReceiveServlet</servlet-class>
<init-param>
<param-name>as2-servlet-config-filename</param-name>
<param-value>config/config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>AS2ReceiveServlet</servlet-name>
<url-pattern>/as2</url-pattern>
</servlet-mapping>
</web-app> As you may see, a reference to the configuration file is needed. You may use the following file as the basis: <?xml version="1.0" encoding="utf-8"?>
<openas2>
<certificates classname="com.helger.as2lib.cert.CertificateFactory"
type="pkcs12"
filename="%home%/certs.p12"
password="test"
interval="300"/>
<partnerships classname="com.helger.as2lib.partner.SelfFillingPartnershipFactory"
filename="%home%/partnerships.xml"/>
<processor classname="com.helger.as2lib.processor.DefaultMessageProcessor"
pendingMDN="data/pendingMDN"
pendingMDNinfo="data/pendinginfoMDN">
<!-- port is required internally - simply ignore it for servlets -->
<module classname="com.helger.as2servlet.util.AS2ServletReceiverModule"
port="10080"
errordir="data/inbox/error"
errorformat="$msg.sender.as2_id$, $msg.receiver.as2_id$, $msg.headers.message-id$"/>
</processor>
</openas2> which in turn references a PKCS12 keystore called hth |
Thank you, I've linked to the configuration file and keystore as you have done above. The above error still however occurs: "java.lang.IllegalStateException: No servlet context path present!" NOTE: The stack trace is same as my previous post above. If you have a working example maven web project, it would be great if you could add that as a usage example on git-hub for the receiver servlet. It would also help others to get the servlet working quickly with basic default configuration. |
Here's what I used for testing: |
Sorry I'm answering quite tense - my time is pretty limited atm. <listener>
<listener-class>com.helger.as2servlet.AS2WebAppListener</listener-class>
</listener to your web.xml - that should resolve the |
Okay, so the stub web app is now contained as an official subproject under the Apache 2 license. hth |
Awesome, thanks! |
Hi there,
I've setup the AS2ReceiveServlet servlet in my web.xml, and created the required config.xml and other files.
I'm getting the following exception after hitting the AS2ReceiveServlet via a browser GET request (http://localhost:8080/test-web/as2/HttpReceiver): "java.lang.IllegalStateException: No global scope object has been set!" (see stacktrace below). Do you have any idea how to resolve this issue?
NOTE: This exception occurs prior to loading the configuration file from web.xml init parameter.
Thanks,
Yusuf
The text was updated successfully, but these errors were encountered: