I updated docx4j from 6.1.2 to 8.0.0 version (https://www.docx4java.org/forums/announces/docx4j-8-0-0-released-t2808.html). I'm using docx4j-JAXB-Internal. When I try to execute, I'm getting the following exception:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Caused by: javax.xml.bind.JAXBException: Can't create internal NamespacePrefixMapper
- with linked exception:
[java.lang.ClassNotFoundException: org.docx4j.jaxb.suninternal.NamespacePrefixMapper]
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:67)
at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:850)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.docx4j.jaxb.suninternal.NamespacePrefixMapper
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:63)
... 6 more
Code:
public class VersionTest {
final static Logger logger = Logger.getLogger(VersionTest.class);
public static void main(String args[]) throws Docx4JException {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File("/home/ubuntu/Documents/Projects/Java_Workspace/Version_Test/input/test.docx"));
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
EndnotesPart endnotePart = wordMLPackage.getMainDocumentPart().getEndNotesPart();
FootnotesPart footnotesPart = wordMLPackage.getMainDocumentPart().getFootnotesPart();
CommentsPart comments = wordMLPackage.getMainDocumentPart().getCommentsPart();
logger.info("documentPart Info "+XmlUtils.marshaltoString(documentPart.getJaxbElement(), true, true) );
}}
Help me out to solve the problem. Thanks in advance.
Win 7, VS2013, .NET 4.5, winforms app
I'm trying to connect to FTP server over SSL/TLS using vb.net. I'm having issues with validating server certificate as ServerCertificateValidationCallback method I'm using seems to be ignored and hence connection to the server never happens, getting a time out error at GetResponse line. I've checked the connection on FileZilla and it works, after adding the server certificate as trusted.
Below's my FtpWebRequest:
ServicePointManager.ServerCertificateValidationCallback = Function(obj as [object], _
cert as X509Certificate, chain as X509Chain, error as SslPolicyErrors) _
(cert.Issuer.Equals("xxxxxx"))
Dim req As System.Net.FtpWebRequest = DirectCast(WebRequest.Create(New Uri("ftp://xxx.xxx.xxx:990")), _
System.Net.FtpWebRequest)
req.EnableSsl = True
req.Credentials = New Net.Credential("user","passw")
req.UsePassive = True
req.UseBinary = True
req.Proxy = Nothing
req.Method = WebRequestMethods.Ftp.ListDirectoryDetails
Dim res As System.Net.FtpWebResponse = DirectCast(req.GetResponse(),System.Net.FtpWebResponse)
I've seen similar topics considering HttpWebRequests, however nothing seems to be usable here. I also enabled tracing to see what's going on in detail:
System.Net Information: 0 : [17056] Current OS installation type is 'Client'.
System.Net Verbose: 0 : [17056] WebRequest::Create(ftp://xxx.xxx.xxx:990/)
System.Net Information: 0 : [17056]
FtpWebRequest#::.ctor(ftp://xxx.xxx.xxx:990/)
System.Net Verbose: 0 : [17056] Exiting WebRequest::Create() ->
FtpWebRequest#
System.Net Verbose: 0 : [17056]
ServicePoint#::ServicePoint(xxx.xxx.xxx:990)
System.Net Verbose: 0 : [17056] FtpWebRequest#::GetResponse()
System.Net Information: 0 : [17056]
FtpWebRequest#::GetResponse(Method=LIST.)
System.Net.Sockets Verbose: 0 : [17056]
Socket#::Socket(AddressFamily#2)
System.Net.Sockets Verbose: 0 : [17056] Exiting Socket#::Socket()
System.Net.Sockets Verbose: 0 : [17056]
Socket#::Socket(AddressFamily#23)
System.Net.Sockets Verbose: 0 : [17056] Exiting Socket#6::Socket()
System.Net.Sockets Verbose: 0 : [17056] DNS::TryInternalResolve(xxx.xxx.xxx)
System.Net.Sockets Verbose: 0 : [17056]
Socket#::Connect(xxx.xxx.xxx:990#-1234)
System.Net.Sockets Information: 0 : [17056] Socket# - Created
connection from xxx to xxx.xxx.xxx:990.
System.Net.Sockets Verbose: 0 : [17056] Exiting Socket#::Connect()
System.Net.Sockets Verbose: 0 : [17056] Socket#::Close()
System.Net.Sockets Verbose: 0 : [17056] Socket#::Dispose()
System.Net.Sockets Verbose: 0 : [17056] Exiting Socket#::Close()
System.Net Information: 0 : [17056] FtpControlStream# - Created
connection from xxx to xxx.xxx.xxx:990.
System.Net Information: 0 : [17056] Associating FtpWebRequest# with
FtpControlStream#
System.Net.Sockets Verbose: 0 : [17056] Socket#::Receive()
The thread 0x4ff0 has exited with code 0 (0x0).
System.Net Information: 0 : [0920] ServicePoint# - Closed as idle.
System.Net.Sockets Error: 0 : [17056]
Socket#::UpdateStatusAfterSocketError() - TimedOut
System.Net.Sockets Error: 0 : [17056] Exception in Socket#::Receive
- A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond.
System.Net.Sockets Verbose: 0 : [17056] Exiting Socket#::Receive()
-> Int32#0
System.Net.Sockets Verbose: 0 : [17056] Socket#::Dispose()
System.Net Information: 0 : [17056] FtpWebRequest#::(Releasing FTP
connection#)
System.Net Error: 0 : [17056] Exception in
FtpWebRequest#::GetResponse - The operation has timed out..
at System.Net.FtpWebRequest.GetResponse()
A first chance exception of type 'System.Net.WebException' occurred in
System.dll
System.Net Verbose: 0 : [17056] Exiting
FtpWebRequest#::GetResponse()
I see that there's an association lacking between FtpWebRequest and service point. Does anyone know how to fix it? I'd appreciate some directions or code samples.
I'm using ~Link~ to create a text to speech function for android in Titanium but I got some problem in development.
The module supported TTS and STT, STT function is fine but the other is not working.
I follow the documentation to create a controllers like this:
var utterance = require('bencoding.utterance'),
speech = utterance.createSpeech();
if(speech.isSpeaking){
Ti.API.info("already speaking");
}
speech.startSpeaking({
text:"こんにちは"
});
When I run the program. Console will show:
[ERROR] : TiApplication: (main) [1191,10337] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.3.0,2014/07/11 12:36,787cd39
[ERROR] : TiApplication: java.lang.NullPointerException
[ERROR] : TiApplication: at bencoding.utterance.SpeechProxy.onInit(SpeechProxy.java:72)
[ERROR] : TiApplication: at android.speech.tts.TextToSpeech.dispatchOnInit(TextToSpeech.java:640)
[ERROR] : TiApplication: at android.speech.tts.TextToSpeech.access$1000(TextToSpeech.java:52)
[ERROR] : TiApplication: at android.speech.tts.TextToSpeech$Connection.onServiceConnected(TextToSpeech.java:1296)
[ERROR] : TiApplication: at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1187)
[ERROR] : TiApplication: at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1204)
[ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:615)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:92)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:155)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5511)
[ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
[ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method)
even I copy the code from example.
Is it my problem? Module is added into the program.
Thank you.
I compile that module with Titanium 3.3.0GA and works the example. What version do you use?
It is importante use this code for test device:
win.addEventListener('open', function()
{
if(!utterance.isSupported())
{
alert("Device not compatible");
}
});
I am working with Mobicents Sip Servlets 3.0.0-SNAPSHOT. I have two servlets configured in the DAR; one to check to see if a third party registration is being attempted, and a second to perform the actual registration. I am finding that when the REGISTER arrives, it is passed to the first servlet (BlockerApp); but when that servlet completes and proxies to the next, that the second servlet (RegApp) is not called. Instead, the first servlet is called again, with the routing directive set to NEW.
Any ideas? Am I missing something?
DAR configuration:
REGISTER=("RegApp","DAR\:From","ORIGINATING","","NO_ROUTE","1"),("BlockerApp","DAR\:From","ORIGINATING","","NO_ROUTE","0")
First Servlet:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.sip.Proxy;
import javax.servlet.sip.SipServlet;
import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;
import javax.servlet.sip.SipURI;
import org.apache.log4j.Logger;
#javax.servlet.sip.annotation.SipServlet(name = "Blocker", loadOnStartup = 1)
public class Blocker extends SipServlet {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(Blocker.class);
private static final String LOOP_CHECK_HEADER = "X-looping";
#Override
protected void doRegister(SipServletRequest req) throws ServletException,
IOException {
logger.info("######################################################");
logger.info("Blocker");
logger.info("region:" + req.getRegion());
logger.info("routing directive:" + req.getRoutingDirective());
logger.info("subscriber uri:" + req.getSubscriberURI());
logger.info("popped route:" + req.getPoppedRoute());
logger.info("######################################################");
if (req.getHeader(LOOP_CHECK_HEADER) != null
&& !req.getHeader(LOOP_CHECK_HEADER).isEmpty()) {
SipServletResponse resp = req
.createResponse(SipServletResponse.SC_FORBIDDEN);
resp.send();
return;
}
req.addHeader(LOOP_CHECK_HEADER, "1");
String toUser = null;
if (req.getTo().getURI().isSipURI()) {
toUser = ((SipURI) req.getTo().getURI()).getUser();
}
String fromUser = null;
if (req.getFrom().getURI().isSipURI()) {
fromUser = ((SipURI) req.getFrom().getURI()).getUser();
}
if (toUser != null && fromUser != null && toUser.equals(fromUser)) {
Proxy proxy = req.getProxy();
proxy.proxyTo(req.getRequestURI());
} else {
SipServletResponse rsp = req.createResponse(
SipServletResponse.SC_DECLINE,
"No third party registrations accepted");
rsp.send();
}
}
}
Second Servlet:
import java.io.IOException;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.sip.Address;
import javax.servlet.sip.SipFactory;
import javax.servlet.sip.SipServlet;
import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;
import javax.servlet.sip.SipURI;
import org.apache.log4j.Logger;
import com.mcleodnet.registrar.business.ContactInformationService;
import com.mcleodnet.registrar.data.ContactUpdate;
#javax.servlet.sip.annotation.SipServlet(name = "Registrar", loadOnStartup = 1)
public class Registrar extends SipServlet {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(Registrar.class);
#EJB(lookup = "java:global/Registrar/RegistrarDatabase/ContactInformationServiceImpl!com.mcleodnet.registrar.business.ContactInformationServiceLocal")
private ContactInformationService cis;
#Resource
SipFactory sipFactory;
#Override
protected void doRegister(SipServletRequest req) throws ServletException,
IOException {
logger.info("######################################################");
logger.info("Registrar");
logger.info("region:" + req.getRegion());
logger.info("routing directive:" + req.getRoutingDirective());
logger.info("subscriber uri:" + req.getSubscriberURI());
logger.info("popped route:" + req.getPoppedRoute());
logger.info("######################################################");
SipServletResponse rsp = req.createResponse(SipServletResponse.SC_OK,
"OK");
Address contactHeader = req.getAddressHeader("contact");
String contactUri = contactHeader.getURI().toString();
String username = null;
if (req.getTo().getURI().isSipURI()) {
username = ((SipURI) req.getTo().getURI()).getUser();
}
int expires = req.getExpires();
if (expires == -1) {
expires = contactHeader.getExpires();
}
if (expires == 0) {
cis.deleteContactInformation(username);
} else {
cis.updateContactInformation(username, new ContactUpdate(
contactUri, expires));
}
rsp.send();
}
}
Log:
11:56:40,296 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) <message
from="192.168.100.125:5090"
to="0.0.0.0:5080"
time="1399921000293"
isSender="false"
transactionId="z9hg4bk-d8754z-7178ee0abc532a51-1---d8754z-"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="REGISTER sip:192.168.100.136:5080 SIP/2.0"
>
<![CDATA[REGISTER sip:192.168.100.136:5080 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
Max-Forwards: 70
Contact: <sip:110#192.168.100.125:5090;rinstance=664938eda63f586d;transport=udp>
To: "110" <sip:110#192.168.100.136:5080>
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
CSeq: 1 REGISTER
Expires: 60
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO
User-Agent: X-Lite release 4.5.5 stamp 71236
Content-Length: 0
]]>
</message>
11:56:40,297 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) ######################################################
11:56:40,298 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) Blocker
11:56:40,298 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) region:ORIGINATING
11:56:40,298 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) routing directive:NEW
11:56:40,299 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) subscriber uri:sip:110#192.168.100.136:5080
11:56:40,299 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) popped route:null
11:56:40,299 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) ######################################################
11:56:40,302 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) <message
from="192.168.100.136:5080"
to="0.0.0.0:5080"
time="1399921000301"
isSender="false"
transactionId="z9hg4bk6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="REGISTER sip:192.168.100.136:5080 SIP/2.0"
>
<![CDATA[REGISTER sip:192.168.100.136:5080 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.136:5080;branch=z9hG4bK6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
Max-Forwards: 69
Contact: <sip:110#192.168.100.125:5090;rinstance=664938eda63f586d;transport=udp>
To: "110" <sip:110#192.168.100.136:5080>
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
CSeq: 1 REGISTER
Expires: 60
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO
User-Agent: X-Lite release 4.5.5 stamp 71236
X-looping: 1
Content-Length: 0
]]>
</message>
11:56:40,303 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) ######################################################
11:56:40,303 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) Blocker
11:56:40,303 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) region:ORIGINATING
11:56:40,304 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) routing directive:NEW
11:56:40,304 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) subscriber uri:sip:110#192.168.100.136:5080
11:56:40,304 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) popped route:null
11:56:40,304 INFO [com.mcleodnet.tpblockerapp.Blocker] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) ######################################################
11:56:40,305 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) <message
from="0.0.0.0:5080"
to="192.168.100.136:5080"
time="1399921000300"
isSender="true"
transactionId="z9hg4bk6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="REGISTER sip:192.168.100.136:5080 SIP/2.0"
>
<![CDATA[REGISTER sip:192.168.100.136:5080 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.136:5080;branch=z9hG4bK6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
Max-Forwards: 69
Contact: <sip:110#192.168.100.125:5090;rinstance=664938eda63f586d;transport=udp>
To: "110" <sip:110#192.168.100.136:5080>
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
CSeq: 1 REGISTER
Expires: 60
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO
User-Agent: X-Lite release 4.5.5 stamp 71236
X-looping: 1
Content-Length: 0
]]>
</message>
11:56:40,307 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-5) <message
from="192.168.100.136:5080"
to="0.0.0.0:5080"
time="1399921000307"
isSender="false"
transactionId="z9hg4bk6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="SIP/2.0 403 Forbidden"
>
<![CDATA[SIP/2.0 403 Forbidden
To: "110" <sip:110#192.168.100.136:5080>;tag=27182159_74a2f52c_f3f49504-2264-4b83-bfe2-48103366fb36
Via: SIP/2.0/UDP 192.168.100.136:5080;branch=z9hG4bK6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
CSeq: 1 REGISTER
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Content-Length: 0
]]>
</message>
11:56:40,305 INFO [org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) Request event dispatched to BlockerApp
11:56:40,308 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) <message
from="0.0.0.0:5080"
to="192.168.100.136:5080"
time="1399921000306"
isSender="true"
transactionId="z9hg4bk6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="SIP/2.0 403 Forbidden"
>
<![CDATA[SIP/2.0 403 Forbidden
To: "110" <sip:110#192.168.100.136:5080>;tag=27182159_74a2f52c_f3f49504-2264-4b83-bfe2-48103366fb36
Via: SIP/2.0/UDP 192.168.100.136:5080;branch=z9hG4bK6ef3edb8-3d39-4b3c-828d-5706b6bce40d_74a2f52c_8017367923679066
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
CSeq: 1 REGISTER
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Content-Length: 0
]]>
</message>
11:56:40,308 INFO [org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) Request event dispatched to BlockerApp
11:56:40,310 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-5) <message
from="0.0.0.0:5080"
to="192.168.100.125:5090"
time="1399921000309"
isSender="true"
transactionId="z9hg4bk-d8754z-7178ee0abc532a51-1---d8754z-"
callId="NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE"
firstLine="SIP/2.0 403 Forbidden"
>
<![CDATA[SIP/2.0 403 Forbidden
To: "110" <sip:110#192.168.100.136:5080>;tag=27182159_74a2f52c_f3f49504-2264-4b83-bfe2-48103366fb36
Via: SIP/2.0/UDP 192.168.100.125:5090;branch=z9hG4bK-d8754z-7178ee0abc532a51-1---d8754z-
CSeq: 1 REGISTER
Call-ID: NjU5YTg5OGRhZjg5YzVjNWEzOWFhYTIyZmJiYjMwZmE
From: "110" <sip:110#192.168.100.136:5080>;tag=52ca933d
Content-Length: 0
]]>
</message>
I now understand why is was not working for me. SIP Servlet chaining using the DAR only works with methods which have dialogs usch as INVITE, SUBSCRIBE, NOTIFY, etc. I have tried using DAR with a multi-servlet application handling an INVITE, and it works as expected.
Application Routing for REGISTER is now fixed in the latest git HEAD
We are using a servlet to access a remote ejb deployed on a different host and getting the
exception mentioned in the stacktrace below.
The remote access works if the servlet client and the remote ejb war are deployed in different domains and on the same host.
Works if they are deployed on the same host and same domain
does not work when deployed on two diffrent hosts.
Looking at the exception"CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No", we thought it could be security issue.
But the test ejb application didnt have any security configurations. Tried adding the "" details to the sun-ejb-jar.xml
and used ProgrammaticLogin api. We got the same exception. Not sure if the security config was correct though.
The glassfish-corba log level was set to finest in the server where the ejb application was deployed. We then got this exception, "
org.omg.CORBA.BAD_INV_ORDER: FINE: IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists vmcid: SUN minor code: 15 completed: No".
The full stacktrace is mentioned below in the server log.
tried using the front-end back-end test cases from Glassfish bug: http://java.net/jira/browse/GLASSFISH-15523. We are
getting the same exception.
Glassfish version: 3.1 build 43
Not sure where we are going wrong. Please help. Thanks.
Client Side log:
Caused by: javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=TestService,Remote 3.x interface =com.medallion.test.service.TestService,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:50.57.150.62:3700#TestService,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'corbaname:iiop:50.57.150.62:3700#TestService__3_x_Internal_RemoteBusinessHome__' [Root exception is org.omg.CORBA.BAD_PARAM: FINE: IOP00100009: string_to_object conversion failed due to bad schema specific part in name TestService__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No]
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:178)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1106)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:172)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 38 more
Caused by: org.omg.CORBA.BAD_PARAM: FINE: IOP00100009: string_to_object conversion failed due to bad schema specific part in name TestService__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy142.soBadSchemaSpecific(Unknown Source)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:227)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:154)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:145)
at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:976)
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:171)
... 43 more
Caused by: org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.handle_null_service_context(SecServerRequestInterceptor.java:421)
at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:443)
at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:612)
at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:612)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:333)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:196)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
----------END server-side stack trace---------- vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:900)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:131)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:637)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:499)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:373)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:273)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:395)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextExtHelper.narrow(NamingContextExtHelper.java:73)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:212)
... 47 more
Server Side log( after setting the corba log level to finest):
[#|2011-12-02T11:37:16.111-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory;MethodName=setAcceptedSocketOptions;|setAcceptedSocketOptions: SocketOrChannelAcceptorImpl[3700 IIOP_CLEAR_TEXT true true] ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=3700] Socket[addr=/173.13.42.205,port=54829,localport=3700]|#]
[#|2011-12-02T11:37:16.113-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=15;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.180-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.179-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor->: [B#77dc7838|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor: [B#77dc7838: ejbId: 4,294,967,297|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor<-: [B#77dc7838: null|#]
[#|2011-12-02T11:37:16.183-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.OMG|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator;MethodName=handleFullLogging;|IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists
org.omg.CORBA.BAD_INV_ORDER: FINE: IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists vmcid: SUN minor code: 15 completed: No
at sun.reflect.GeneratedConstructorAccessor729.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy210.serviceContextAddFailed(Unknown Source)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.enqueue(ServerRequestInfoImpl.java:702)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.add_reply_service_context(ServerRequestInfoImpl.java:482)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.setCurrentExecutionPoint(ServerRequestInfoImpl.java:738)
at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIEndingPoint(PIHandlerImpl.java:632)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.runInterceptors(CorbaMessageMediatorImpl.java:2189)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createResponseHelper(CorbaMessageMediatorImpl.java:2101)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createResponseHelper(CorbaMessageMediatorImpl.java:2089)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createSystemExceptionResponse(CorbaMessageMediatorImpl.java:2014)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1796)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1758)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:255)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
|#]
Code used:
Client:
servlet:
#WebServlet("/TestServlet")
public class TestServlet extends HttpServlet {
#EJB(name = "TestService")
private TestService testService;
/**
* #see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter w = response.getWriter();
try {
w.write("Test o/p: " + testService.testEJB("This is a test msg") + "\n");
} catch (Exception e) {
e.printStackTrace(w);
}
}
}
sun-web.xml:
<ejb-ref>
<ejb-ref-name>TestService</ejb-ref-name>
<!-- <jndi-name>corbaname:iiop:localhost:3700#TestService</jndi-name> -->
<jndi-name>corbaname:iiop:<ip>:3700#TestService</jndi-name>
</ejb-ref>
Remote ejb:
#Stateless(mappedName="TestService")
public class TestServiceImpl implements Serializable, TestService {
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(TestServiceImpl.class.getName());
#Resource EJBContext ejbContext;
#Override
public String testEJB(String testStr) {
String userName = ejbContext.getCallerPrincipal().getName();
System.out.println("Username: " + userName);
return "Msg Recieved: " + testStr;
}
sun-ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>TestServiceImpl</ejb-name>
<jndi-name>TestService</jndi-name>
<!--<ior-security-config>
<as-context>
<auth-method>USERNAME_PASSWORD</auth-method>
<realm>database-realm</realm>
<required>true</required>
</as-context>
<sas-context>
<caller-propagation>supported</caller-propagation>
</sas-context>
<transport-config>
<establish-trust-in-client>supported</establish-trust-in-client>
</transport-config>
</ior-security-config>-->
</ejb>
</enterprise-beans>
<security-role-mapping>
</security-role-mapping>
</sun-ejb-jar>
Perhaps not the answer to your question but I'll mention this here:
We had a similar problem with glassfish 3.1.2 where the occurring exception mentions CORBA.NO_PERMISSION and there is no stacktrace on the server side. Somewhere in the logfile we found the Exception Invalid iiop-listener orb-listener-1. Lazy-init not supported for SSL iiop-listeners
This is a bug in glassfish see:
https://java.net/jira/browse/GLASSFISH_CORBA-13
The glassfish admin interface automatically adds an SSL entry to the configured non SSL iiop-listener, due to this, the exception occures and remoting won't work anymore. As workaround you can remove the SSL-config-entry from the domain.xml manually to get remoting work again. But a soon as you open the IOP-Listener section again in the admin interface, the entry will be created again on glassfish restart.