How to debug "[AxisServlet]: java.lang.NoClassDefFoundError: org.apache.woden.resolver.URIResolver" in Axis2 1.3 and WebSphere 8.5?
I have tried the solutions from the below link shared but did not resolve the issue and still I am getting subjected error.
See also questions close to this topic
-
Trying to convert PHP SOAP API to python client
I have the following code that uses stamps api to check for package pickup availability (https://swsim.stamps.com/swsim/swsimv62.asmx?op=CheckCarrierPickupAvailability) with PHP.
<?php require_once 'Stamps.php'; $address = $_GET['Address']; $city = $_GET['City']; $state = $_GET['State']; $zip = $_GET['Zip']; $wsdl = WSDL; $trace = true; $exceptions = false; $AC = array( 'Credentials'=>array('IntegrationID' => INTEGRATIONID,'Username' => USERNAME,'Password'=>PASSWORD), 'Address'=>array('Address'=>$address,'City'=>$city,'State'=>$state,'ZIP'=>$zip) ); $error=2; $error_message=''; try { $client = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions)); $response = $client->CheckCarrierPickupAvailability($AC); $error=0; } catch (Exception $e) { #echo "Error!"; $error_message = $e -> getMessage (); #echo 'Last response: '. $client->__getLastResponse(); $error=1; header('Content-Type: application/json'); echo '{"response":"error","error_message": "Address not found"}'; exit(); } if($error==0){ $PickUpDayOfWeek =$response->PickUpDayOfWeek; $PickupDate = $response->PickupDate; if(!empty($PickupDate)){ header('Content-Type: application/json'); echo '{"response":"ok","PickupDate": "'.$PickupDate.'", "PickUpDayOfWeek": "'.$PickUpDayOfWeek.'"}'; }else{ header('Content-Type: application/json'); echo '{"response":"error","error_message": "Address not found"}'; } }else{ header('Content-Type: application/json'); echo '{"response":"error","error_message": "Address not found"}'; }
And another file called Stamps.php:
<?php /** * Stamps Api Login Credentials **/ define("INTEGRATIONID", "integration-id"); define("USERNAME", "user"); define("PASSWORD", "pass"); define("WSDL","https://swsim.stamps.com/swsim/swsimv62.asmx?wsdl");
Since I have been trying to convert the code into python, I have been looking into libraries such as "suds" and "Zeep" but have had no luck since I am really confused on how I would integrate the integration id into the call.
I have also looked into this wrapper (https://github.com/jzempel/stamps) but ran into issues adding functionality for checking package pickup availability since I had to alter the wsdl and was obtaining errors on how the stuff I put into the wsdl wasn't even being seen.
-
Create Postman request from WSDL API
I've a problem trying to use POSTMAN application. I usually use SOAPUI to do SOAP request from a WSDL URL and it's quite simple to import all request from that URL. But in POSTMAN I cannot get the same result. I know how to create a collection and create manually all the requests, but not sure how can I automatically generate all the requests from the WSDL. I tried installing WSDL2Postman from NPM but when I execute the command
npm i -g wsdl2postman
I receive an error like this:
npm ERR! code E404 npm ERR! 404 Not Found: wsdl2postman@latest
And if check the complete log, this is what I receive:
0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'i', 1 verbose cli '-g', 1 verbose cli 'wsdl2postman' ] 2 info using npm@6.4.1 3 info using node@v10.15.1 4 verbose npm-session f3af42bfbcc33735 5 silly install loadCurrentTree 6 silly install readGlobalPackageData 7 http fetch GET 404 https://registry.npmjs.org/wsdl2postman 3885ms 8 silly fetchPackageMetaData error for wsdl2postman@latest 404 Not Found: wsdl2postman@latest 9 timing stage:rollbackFailedOptional Completed in 3ms 10 timing stage:runTopLevelLifecycles Completed in 4305ms 11 verbose stack Error: 404 Not Found: wsdl2postman@latest 11 verbose stack at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19) 11 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23) 11 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31) 11 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18) 11 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10) 11 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18) 11 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16) 11 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10) 11 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14) 11 verbose stack at runCallback (timers.js:705:18) 11 verbose stack at tryOnImmediate (timers.js:676:5) 11 verbose stack at processImmediate (timers.js:658:5) 12 verbose cwd C:\Users\Ignacio 13 verbose Windows_NT 10.0.17134 14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "wsdl2postman" 15 verbose node v10.15.1 16 verbose npm v6.4.1 17 error code E404 18 error 404 Not Found: wsdl2postman@latest 19 verbose exit [ 1, true ]
So, question is, is there any way to generate SOAP requests from WSDL URL automatically?
Thanks in advance
-
Visual Studio Windows Form Adding Web Service Reference Error: Could not create SSL/TLS secure channel
Im trying to add wsdl web service in windows form application to connect a web service. It gives error of
"The request was aborted: Could not create SSL/TLS secure channel."
here is the screenshot regarding the issue:
I checked the similar questions but they didnt help. How can i get out this issue. im using Windows 10, Visual Studio 2013
Any help is appreciated.
-
cannot start MVC project on java 1.7
I have a task to create a Spring MVC project with MVC version 3.x and using Java 7. I spent more than 15 unsuccessful attempts and more than 30 hours for this - please do not drop this question and try to help me. When I launch the project, using JDK8 - all wors fine, but when I choose
JDK-7
- I have some exceptions:
org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Catalina].StandardHost[localhost].StandardContext [/springMvcAttempt17_war]] Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
SEVERE: Exception invoking method manageApp java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springMvcAttempt17_war]]
SEVERE: Exception invoking method createStandardContext javax.management.RuntimeOperationsException: Exception invoking method manageApp at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:308) Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springMvcAttempt17_war]]
So, project:
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.exercise</groupId> <artifactId>springMvcAttempt17</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>spring3 mvc maven</name> <properties> <jdk.version>1.7</jdk.version> <spring.version>3.2.13.RELEASE</spring.version> <jstl.version>1.2</jstl.version> </properties> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>${jstl.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin> <!-- embedded Jetty server, for testing --> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.11.v20150529</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <webApp> <contextPath>/spring3</contextPath> </webApp> </configuration> </plugin> </plugins> </build>
web.xml:
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Spring MVC Application</display-name> <servlet> <servlet-name>spring-web</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring-web</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-web-servlet.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>
spring-web-servlet.jsp:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"> <context:component-scan base-package="com.exercise.springMvcAttempt17" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix"> <value>/WEB-INF/views/jsp/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <mvc:resources mapping="/resources/**" location="/resources/" /> <mvc:annotation-driven /> </beans>
And exception stacktrace:
SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springMvcAttempt17_war]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1692) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:465) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1488) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1329) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1421) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:849) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$2.run(Transport.java:202) at sun.rmi.transport.Transport$2.run(Transport.java:199) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:198) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView; at org.apache.catalina.core.StandardContext.findParameters(StandardContext.java:3585) at org.apache.catalina.core.StandardContext.mergeParameters(StandardContext.java:5418) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5247) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) ... 44 more Feb 16, 2019 9:18:07 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke SEVERE: Exception invoking method manageApp java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springMvcAttempt17_war]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1692) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:465) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1488) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1329) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1421) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:849) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$2.run(Transport.java:202) at sun.rmi.transport.Transport$2.run(Transport.java:199) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:198) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Feb 16, 2019 9:18:07 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke SEVERE: Exception invoking method createStandardContext javax.management.RuntimeOperationsException: Exception invoking method manageApp at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:308) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:465) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1488) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1329) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1421) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:849) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$2.run(Transport.java:202) at sun.rmi.transport.Transport$2.run(Transport.java:199) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:198) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springMvcAttempt17_war]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1692) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ... 35 more
-
Can an object be defined that has a string integer and a list attatched to it?
I need to make an object that has a name, points, and a list of other string and when i declared such an object, it says "error: illegal start of expression"
this is main class where i have declared the echipa object
class main { public static void main(String[] args) { //here Echipa echipa1 = new Echipa("FC A",0,[11]); for(i=0;i<11;i++) { echipa1[i] = "jucator"; } System.out.println(echipa1.getName()); System.out.println(echipa1.getPuncte()); System.out.println(echipa1.getJucatori()); } }
this is echipa class where i defined echipa
class Echipa extends Liga { int puncte; String[] jucatori; public Echipa(String name, int puncte, String[] jucatori) { super(name); this.puncte = puncte; this.jucatori[] = jucatori[]; } public String getName() { return name; } public int getPuncte() { return puncte; } public String getJucatori() { for(i=0;i<11;i++) { return jucatori[i]; } } }
Expected:
//Shown in cmd FC A 0 jucator jucator jucator jucator jucator jucator jucator jucator jucator jucator jucator
Actual:
main.java:7: error: illegal start of expression Echipa echipa1 = new Echipa("FC A",0,[11]); ^ main.java:7: error: ';' expected Echipa echipa1 = new Echipa("FC A",0,[11]); ^ 2 errors
-
Invalid flag -parameters in java 1.7
I have the task to create the spring-boot application using Java 7.
So, as usual, I created a template on start.spring.io resource and open him via
File -> New -> Project from Existing Sources...
When I run with
jdk-8
, everything works fine, but when I change JDK to version 1.7 (also I changejava-version
inpom.xml
) I get a compilation error:Error:java: invalid flag: -parameters
Screenshot:
Pom.xml:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.exercise</groupId> <artifactId>quadratic</artifactId> <version>0.0.1-SNAPSHOT</version> <name>quadratic</name> <description>Demo project for Spring Boot</description> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
I have no created any classes in this project.
-
Spring boot application with custom config does not load on server(websphere) startup
I have a spring boot application which connects to two data sources using mybatis. Spring boot does not load on server startup, I have checked the logs during the server startup and I do not see any spring boot related messages in it. The application status is displayed as Started in the WAS console after the server startup.
The application does not work until I restart it, and during the application restart, I can see the spring boot related messages in the logs. The application works fine after its restarted.
Server version: IBM WebSphere Application Server Network Deployment (8.5.5.14) Java version: 8.0.2.10 (IBM WebSphere SDK Java Technology Edition)
@SpringBootApplication @ComponentScan(basePackages="org.sample.solve.*") @MapperScan("org.sample.solve.sa.db.mappers") public class SampleApplication { public static void main(String[] args) { SpringApplication.run(SampleApplication.class, args); } }
Configuration :
package org.sample.solve.sa; import ..... @Configuration public class MybatisDBConfig { private final Logger log = LoggerFactory.getLogger(this.getClass()); public static final String SQL_SESSION_FACTORY_NAME_1 = "sqlSessionFactory1"; public static final String SQL_SESSION_FACTORY_NAME_2 = "sqlSessionFactory2"; public static final String MAPPERS_PACKAGE_TSC = "org.sample.solve.sa.db.mappers"; // mapper interface package public static final String MAPPERS_PACKAGE_SERVICES_DB = "org.sample.solve.sa.db.services_db.mappers"; // mapper interface package @Profile("local") @Bean(name = "tscDB") @Primary @ConfigurationProperties(prefix = "sp.firstDatasource") public DataSource dataSource1() { DataSource dataSource = null; try { dataSource = DataSourceBuilder.create().build(); log.info("tsc datasource"); }catch(Exception excep) { excep.printStackTrace(); } return dataSource; } @Profile("local") @Bean(name = "servicesDB") @ConfigurationProperties(prefix = "sp.secondDatasource") public DataSource dataSource2() { DataSource dataSource = null; try { dataSource = DataSourceBuilder.create().build(); log.info("services datasource"); }catch(Exception excep) { excep.printStackTrace(); } return dataSource; } @Profile({"dev", "fvt", "uat", "prod"}) @Bean(name = "tscDB") @Primary public DataSource primaryDataSource() { System.out.println("sacpDS_JNDI : jdbc/QAServiceSACP"); JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup(); DataSource dataSource = dataSourceLookup.getDataSource("jdbc/QAServiceSACP"); return dataSource; } @Profile({"dev", "fvt", "uat", "prod"}) @Bean(name = "servicesDB") public DataSource secondaryDataSource() { System.out.println("servicesDS_JNDI : jdbc/servicesDS"); JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup(); DataSource dataSource = dataSourceLookup.getDataSource("jdbc/servicesDS"); return dataSource; } @Bean(name = SQL_SESSION_FACTORY_NAME_1) @Primary public SqlSessionFactory sqlSessionFactory1(@Qualifier("tscDB") DataSource dataSource1) throws Exception { SqlSessionFactory sqlSessionFactory = null; try { SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); sqlSessionFactoryBean.setTypeAliasesPackage("org.sample.solve.sa.pojo"); Resource[] mapperLocations = new Resource[] { new ClassPathResource("SASolveMapper.xml") }; sqlSessionFactoryBean.setMapperLocations(mapperLocations); sqlSessionFactoryBean.setDataSource(dataSource1); sqlSessionFactory = sqlSessionFactoryBean.getObject(); sqlSessionFactory.getConfiguration().setMapUnderscoreToCamelCase(true); sqlSessionFactory.getConfiguration().setJdbcTypeForNull(JdbcType.NULL); }catch(Exception excep) { excep.printStackTrace(); throw new Exception(excep.getMessage()); } return sqlSessionFactory; } @Bean(name = SQL_SESSION_FACTORY_NAME_2) public SqlSessionFactory sqlSessionFactory2(@Qualifier("servicesDB") DataSource dataSource2) throws Exception { SqlSessionFactory sqlSessionFactory = null; try { SqlSessionFactoryBean diSqlSessionFactoryBean = new SqlSessionFactoryBean(); diSqlSessionFactoryBean.setTypeAliasesPackage("org.sample.solve.sa.pojo"); Resource[] mapperLocations = new Resource[] {new ClassPathResource("ServicesDBMapper.xml")}; diSqlSessionFactoryBean.setMapperLocations(mapperLocations); diSqlSessionFactoryBean.setDataSource(dataSource2); sqlSessionFactory = diSqlSessionFactoryBean.getObject(); sqlSessionFactory.getConfiguration().setMapUnderscoreToCamelCase(true); sqlSessionFactory.getConfiguration().setJdbcTypeForNull(JdbcType.NULL); }catch(Exception excep) { excep.printStackTrace(); throw new Exception(excep.getMessage()); } return sqlSessionFactory; } @Bean @Primary public MapperScannerConfigurer mapperScannerConfigurer1() { MapperScannerConfigurer configurer = new MapperScannerConfigurer(); configurer.setBasePackage(MAPPERS_PACKAGE_TSC); configurer.setSqlSessionFactoryBeanName(SQL_SESSION_FACTORY_NAME_1); return configurer; } @Bean public MapperScannerConfigurer mapperScannerConfigurer2() { MapperScannerConfigurer configurer = new MapperScannerConfigurer(); configurer.setBasePackage(MAPPERS_PACKAGE_SERVICES_DB); configurer.setSqlSessionFactoryBeanName(SQL_SESSION_FACTORY_NAME_2); return configurer; } }
And I am setting the active profile using a servlet initializer.
-
Encoding issue on WebSphere 8.5.5.14 for a Java Application - XML parsing: line 1, character 39, unable to switch the encoding
I have this setup in my local and i am facing this error as part of inserting an xml string to an xml type column in sql table. Please review this and share your thoughts to resolve this issue.
NOTE: I am using SAXBuilder for xmldocument and used format.setEncoding("UTF-16") before passing that xml document as parameter. Also to note, i dont see any such issue when i run my application using tomcat 8 and 9. I am seeing this issue only when i have integrated with WebSphere.
Server: Websphere Application Server 8.5.5.14 SQL Server: 2014 JDBC used: sqlJdbc41.jar and sqljdbc4.jar Targetted IBM JDK used: jdk1.7_64
Error Details: Cause SQL Exception Info for exception at level 0 - SQL State: 'S0001'; SQL Error Number: '9402'; SQL Error Text: 'XML parsing: line 1, character 39, unable to switch the encoding
com.microsoft.sqlserver.jdbc.SQLServerException: XML parsing: line 1, character 39, unable to switch the encoding
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1295) at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:836)
Tried the following options and i did not help.
Updated WebSphere\AppServer\Properties\encoding.properties (WAS) file to keep this entry en=ISO-8859-1 as en=UTF-8.
Also tried the above with UTF-16 as well.
Tried to update the following in JVC generic arguments as well. -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8
Since my application working with tomcat, so i did not expect to change any code to correct the xml string by using CAST / or passing the xmlstring with prefix N'xxxmlxx'. I will be trying this code change as well shortly. Meanwhile any other thoughts would really help.
Do i need to try with latest jdbc jar (mssql-jdbc-6.2.2.jre7.jar)? Do i need to try with websphere bundled sdk 1.8?
-
Run two war instances in the same server.xml config
I've generated two instances of Spring Boot (1.5.10.RELEASE) (war) with different properties (DB), My question is about to run those two instances with same port but with different context in WebSphere Liberty Core 8.5 ?
My server.xml :
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9081" httpsPort="9443"/> <!-- A application --> <webApplication id="A" location="A-0.0.1-SNAPSHOT.war" contextRoot="/interactioncorpcontext-a"/> <!-- B application --> <webApplication id = "B" location="B-0.0.1-SNAPSHOT.war" contextRoot="/interactioncorpcontext-b"/>
As result :
**http://hostname:9081/interactioncorpcontext-a** **http://hostname:9081/interactioncorpcontext-b**