2 new revisions:

Revision: 1c4539aafef1
Author:   Jean Deruelle <[email protected]>
Date:     Thu Aug 16 08:03:05 2012
Log:      Update Issue 148...
http://code.google.com/p/sipservlets/source/detail?r=1c4539aafef1

Revision: 1d65d8a8c744
Author:   Jean Deruelle <[email protected]>
Date:     Thu Aug 16 08:25:48 2012
Log:      Fixes Issue 150
http://code.google.com/p/sipservlets/source/detail?r=1d65d8a8c744

==============================================================================
Revision: 1c4539aafef1
Author:   Jean Deruelle <[email protected]>
Date:     Thu Aug 16 08:03:05 2012
Log:      Update Issue 148

Fix  NPE for applications not having the @SipApplicationKey annotations

http://code.google.com/p/sipservlets/source/detail?r=1c4539aafef1

Modified:
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SIPWebContext.java /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/servlet/sip/startup/jboss/SipJBossContextConfig.java

=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SIPWebContext.java Tue Aug 14 19:06:48 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment/SIPWebContext.java Thu Aug 16 08:03:05 2012
@@ -105,7 +105,9 @@

     @Override
     public void start() throws LifecycleException {
- log.infof("Starting sip web context for deployment %s", deploymentUnit.getName());
+       if(log.isInfoEnabled()) {
+ log.infof("Starting sip web context for deployment %s", deploymentUnit.getName());
+       }
SipMetaData sipMetaData = deploymentUnit.getAttachment(SipMetaData.ATTACHMENT_KEY); SipAnnotationMetaData sipAnnotationMetaData = deploymentUnit.getAttachment(SipAnnotationMetaData.ATTACHMENT_KEY);

@@ -119,7 +121,7 @@
         try {
                        processMetaData(mergedMetaData, sipMetaData);
                } catch (Exception e) {
-                       throw new LifecycleException(e);
+ throw new LifecycleException("An unexpected exception happened while parsing sip meta data from " + deploymentUnit.getName(), e);
                }

         super.start();
=======================================
--- /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/servlet/sip/startup/jboss/SipJBossContextConfig.java Tue Aug 14 19:06:48 2012 +++ /containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/servlet/sip/startup/jboss/SipJBossContextConfig.java Thu Aug 16 08:03:05 2012
@@ -329,16 +329,18 @@
             }
         }
final SipApplicationKeyMethodInfo sipApplicationKeyMethodInfo = convergedMetaData.getSipApplicationKeyMethodInfo(); - final String sipApplicationKeyClassName = sipApplicationKeyMethodInfo.getClassName(); - final String sipApplicationKeyMethodName = sipApplicationKeyMethodInfo.getMethodName();
-        ClassLoader contextCLoader = context.getLoader().getClassLoader();
-        Method sipApplicationKeyMethod = null;
-        try {
- sipApplicationKeyMethod = Class.forName(sipApplicationKeyClassName, true, contextCLoader).getMethod(sipApplicationKeyMethodName, SipServletRequest.class);
-        } catch (Exception e) {
-               throw e;
+        if(sipApplicationKeyMethodInfo != null) {
+ final String sipApplicationKeyClassName = sipApplicationKeyMethodInfo.getClassName(); + final String sipApplicationKeyMethodName = sipApplicationKeyMethodInfo.getMethodName();
+               ClassLoader contextCLoader = 
context.getLoader().getClassLoader();
+               Method sipApplicationKeyMethod = null;
+               try {
+ sipApplicationKeyMethod = Class.forName(sipApplicationKeyClassName, true, contextCLoader).getMethod(sipApplicationKeyMethodName, SipServletRequest.class);
+               } catch (Exception e) {
+                       throw e;
+               }
+ convergedContext.setSipApplicationKeyMethod(sipApplicationKeyMethod);
         }
- convergedContext.setSipApplicationKeyMethod(sipApplicationKeyMethod); convergedContext.setConcurrencyControlMode(convergedMetaData.getConcurrencyControlMode());
         convergedContext.setWrapperClass(StandardWrapper.class.getName());
     }

==============================================================================
Revision: 1d65d8a8c744
Author:   Jean Deruelle <[email protected]>
Date:     Thu Aug 16 08:25:48 2012
Log:      Fixes Issue 150

http://code.google.com/p/sipservlets/source/detail?r=1d65d8a8c744

Modified:
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/session/ConvergedSessionDelegate.java

=======================================
--- /containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/session/ConvergedSessionDelegate.java Mon Aug 13 12:29:49 2012 +++ /containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/session/ConvergedSessionDelegate.java Thu Aug 16 08:25:48 2012
@@ -116,7 +116,19 @@
                Host host = (Host)context.getParent();
                //Service
                Service service = ((Engine)host.getParent()).getService();
-               String hostname = host.getName();
+               String[] aliases = host.findAliases();
+               String hostname = null;
+
+               // Needed for 
http://code.google.com/p/sipservlets/issues/detail?id=150
+ // to pass TCK test com.bea.sipservlet.tck.agents.api.javax_servlet_sip.ConvergedHttpSessionTest.testEncodeURL002
+               if(aliases.length < 1) {
+                       hostname = host.getName();
+               } else {
+ // FIXME would be better to try to match the alias by some path or IP but unaware if this is really needed at this point
+                       // or how it can be effectively done
+                       hostname = aliases[0];
+               }
+
                //retrieving the port corresponding to the specified scheme
                //TODO ask EG what if the scheme is not supported on the server 
?
                int port = -1;

Reply via email to