axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject cvs commit: ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/wsutils PropertyLoader.java
Date Wed, 07 Jul 2004 14:04:49 GMT
hemapani    2004/07/07 07:04:48

  Modified:    contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/wrapperWs
                        SimpleRemoteInterfaceBasedWrapperClassWriter.java
               contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils/packager
                        JARFile.java
               contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs
                        Ws4J2EEwithoutWSDL.java
               contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/wsutils
                        PropertyLoader.java
  Log:
  fix the error loading the jndi.properties file in inside the wsbservice
  
  Revision  Changes    Path
  1.6       +19 -9     ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/wrapperWs/SimpleRemoteInterfaceBasedWrapperClassWriter.java
  
  Index: SimpleRemoteInterfaceBasedWrapperClassWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/wrapperWs/SimpleRemoteInterfaceBasedWrapperClassWriter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleRemoteInterfaceBasedWrapperClassWriter.java	7 Jul 2004 09:02:00 -0000	1.5
  +++ SimpleRemoteInterfaceBasedWrapperClassWriter.java	7 Jul 2004 14:04:48 -0000	1.6
  @@ -83,6 +83,7 @@
   		out.write("\tpublic void setMessageContext(org.apache.axis.MessageContext msgcontext){;\n");
   		out.write("\t\tthis.msgcontext = msgcontext;\n");
   		out.write("\t}\n");
  +		
   		writeGetRemoteRef(classname);
   		
   		String parmlistStr = null;
  @@ -136,16 +137,23 @@
   	   out.write("\t\tif(msgcontext == null){\n");
   	   out.write("\t\t		msgcontext = org.apache.axis.MessageContext.getCurrentContext();\n");
   	   out.write("\t\t}\n");
  +	   out.write("\t\tif(msgcontext == null){\n");
  +       out.write("\t\t		throw new RuntimeException(\"Message Context can not be null\");\n");
  +	   out.write("\t\t}\n");
  +	   
   	   out.write("\t\torg.apache.geronimo.ews.ws4j2ee.context.security.SecurityContext4J2EE
seccontext =\n"); 
   	   out.write("\t\t			   (org.apache.geronimo.ews.ws4j2ee.context.security.SecurityContext4J2EE)msgcontext\n");
   	   out.write("\t\t.getProperty(org.apache.ws.axis.security.WSS4J2EEConstants.SEC_CONTEXT_4J2EE);\n");
  -	   out.write("\t\t    javax.security.auth.callback.CallbackHandler handler\n");
  -	   out.write("\t\t        = seccontext.getPWDCallbackHandler4J2EE();\n");
  -	   out.write("\t\t    if(handler != null){\n");
  -	   out.write("\t\t        javax.security.auth.login.LoginContext lc\n"); 
  -	   out.write("\t\t            = new javax.security.auth.login.LoginContext(\"TestClient\",
handler);\n");
  -	   out.write("\t\t        lc.login();\n");
  -	   out.write("\t\t    }\n");
  +	   out.write("\t\tif(seccontext != null){\n");
  +	   out.write("\t\t\t    javax.security.auth.callback.CallbackHandler handler\n");
  +	   out.write("\t\t\t        = seccontext.getPWDCallbackHandler4J2EE();\n");
  +	   out.write("\t\t\t    if(handler != null){\n");
  +	   out.write("\t\t\t        javax.security.auth.login.LoginContext lc\n"); 
  +	   out.write("\t\t\t            = new javax.security.auth.login.LoginContext(\"TestClient\",
handler);\n");
  +	   out.write("\t\t\t        lc.login();\n");
  +	   out.write("\t\t\t    }\n");
  +	   out.write("\t\t}\n");
  +	   
   	   out.write("\t\t}catch (javax.security.auth.login.LoginException e) {\n");
   	   out.write("\t\t     e.printStackTrace();\n");
   	   out.write("\t\t     throw org.apache.axis.AxisFault.makeFault(e);\n");
  @@ -156,9 +164,11 @@
   //	   out.write("\t\t\tjava.util.Properties env = new java.util.Properties();\n");
   //	   out.write("\t\t\tenv.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,\""+getJNDIInitialContextFactory()+"\");\n");
   //	   out.write("\t\t\tenv.put(javax.naming.Context.PROVIDER_URL, \""+getJNDIHostAndPort()+"\");\n");
  -
  +	   out.write("\t\t\tjava.util.Properties env = new java.util.Properties();\n");
  +	   out.write("env.load(getClass().getClassLoader().getResourceAsStream(\"jndi.properties\"));\n");
   //use the propertyfile
  -  	   out.write("\t\t\tjava.util.Properties env = " +
  			"org.apache.geronimo.ews.ws4j2ee.wsutils.PropertyLoader.loadProperties(\"jndi.properties\");\n");
  +//       out.write("\t\t\torg.apache.geronimo.ews.ws4j2ee.wsutils.PropertyLoader ploader
= new org.apache.geronimo.ews.ws4j2ee.wsutils.PropertyLoader();\n");
  +//  	   out.write("\t\t\tjava.util.Properties env = " +
//  			"ploader.loadProperties(\"jndi.properties\");\n");
   		
   	   out.write("\t\t\tjavax.naming.Context initial = new javax.naming.InitialContext(env);\n");
	
   	   String ejbname = j2eewscontext.getMiscInfo().getTargetPortType().getName().toLowerCase();
  
  
  
  1.7       +1 -0      ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils/packager/JARFile.java
  
  Index: JARFile.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/utils/packager/JARFile.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JARFile.java	27 Jun 2004 15:20:24 -0000	1.6
  +++ JARFile.java	7 Jul 2004 14:04:48 -0000	1.7
  @@ -99,6 +99,7 @@
   
       public void addJarFile(String jarFile) throws GenerationFault {
           try {
  +            System.out.println("adding "+jarFile);
               JarFile file = new JarFile(jarFile);
               Enumeration e = file.entries();
               while (e.hasMoreElements()) {
  
  
  
  1.12      +7 -0      ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/Ws4J2EEwithoutWSDL.java
  
  Index: Ws4J2EEwithoutWSDL.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/toWs/Ws4J2EEwithoutWSDL.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Ws4J2EEwithoutWSDL.java	22 Jun 2004 09:13:43 -0000	1.11
  +++ Ws4J2EEwithoutWSDL.java	7 Jul 2004 14:04:48 -0000	1.12
  @@ -324,6 +324,13 @@
                           wscontext,
                           GenerationConstants.EJB_GENERATOR)
                       .generate();
  +				if (verbose)
  +						log.info("genarating j2ee dd >>");
  +					Generator j2eeContainerDDGen =
  +						GeneratorFactory.createGenerator(
  +							wscontext,
  +							GenerationConstants.J2EE_CONTAINER_DD_GENERATOR);
  +					j2eeContainerDDGen.generate();    
               } else {
                   wscontext.getMiscInfo().setImplwithEJB(false);
                   //parse the web.xml file and gereratre wrapper
  
  
  
  1.3       +2 -2      ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java
  
  Index: PropertyLoader.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyLoader.java	14 Jun 2004 08:31:15 -0000	1.2
  +++ PropertyLoader.java	7 Jul 2004 14:04:48 -0000	1.3
  @@ -12,10 +12,10 @@
    * @author Srinath Perera(hemapani@opensource.lk)
    */
   public class PropertyLoader {
  -	public static Properties loadProperties(String propertyFile) throws GenerationFault{
  +	public Properties loadProperties(String propertyFile) throws GenerationFault{
   		try {
   			Properties properties = new Properties();
  -			InputStream proIn = PropertyLoader.class.getResourceAsStream(propertyFile);
  +			InputStream proIn = getClass().getClassLoader().getResourceAsStream(propertyFile);
   			if(proIn == null){
   				proIn = GenerationConstants.class.getResourceAsStream("META-INF/"+propertyFile);
   			}
  
  
  

Mime
View raw message