简体   繁体   中英

Unable to deploy WebService in Weblogic 12c on LINUX

Using JAX-WS we have developed a WebService and unable to deploy on WebLogic 12c running on LINUX JAVA 64Bit. However, same WAR file is deployed on WebLogic 12c running on Windows 7 using JAVA 32Bit and it works perfect. Here are the infos. Please let us know where / what could have gone wrong from our side. Thanks in advance

WebLogic Production Log

####<Nov 17, 2014 3:50:36 PM MYT> <Info> <Deployer> <Host> <Managed1>   
<Module GetShipmentChargeDetails.war of application GetShipmentChargeDetails 
      successfully transitioned from STATE_PREPARED to STATE_ADMIN on server Managed1.>
####<Nov 17, 2014 3:50:36 PM MYT> <Info> <ServletContext-/GetShipmentChargeDetails>   
<No Spring WebApplicationInitializer types detected on classpath>
<Servlet: "ShipmentChargeWSServlet" failed to preload on 
      startup in Web application: "GetShipmentChargeDetails.war".
javax.xml.ws.WebServiceException: java.lang.NoClassDefFoundError: 
Could not initialize class com.company.scws.service.GetShipmentChargeDetails

Error Message
Web Service does not use any Spring related

<No Spring WebApplicationInitializer types detected on classpath>

Thanks in advance and appreciate any help/hint.

Finally I found what was going on. It was basically misleading error log from WebLogic 12c. The problem was not related to <No Spring WebApplicationInitializer types detected on classpath> or java.lang.NoClassDefFoundError .

WebService class was getting instance of another class which in turn was loading properties (application.props) which was not found on the classpath. Instead of throwing NullPointer for prop file not found, system was showing different error message at WebService deployment.

Error was due to APP_PROP_FILE was not in any classpath

applicationProps.load(AppUtils.class.getClassLoader().getResourceAsStream(
                    APP_PROP_FILE));

Sample snippets

    static Properties applicationProps;
    public static synchronized AppUtils getInstance() {
        if (appUtils == null) 
            appUtils = new AppUtils();
        return AppUtils;
    }
    public AppUtils() {
        PropertyConfigurator.configure(System.getProperty("log4j.configuration"));
        loadProperties();
    }
    public static Properties getApplicationProps() {
        if (applicationProps == null)
            loadProperties();
        return applicationProps;
    }
    private static void loadProperties() {
        applicationProps = new Properties();
        try {
            applicationProps.load(AppUtils.class.getClassLoader().getResourceAsStream(
                    APP_PROP_FILE));
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM