Found an unexpected Node #text with name = null and with text content = - java

While deploying a service to weblogic I got the following exception despite cxf successfully generating sources:
weblogic.management.DeploymentException: Error encountered during prepare phase
of deploying WebService module 'brt-service-1.0.war'. While deploying WebService
module 'brt-service-1.0.war'. Error encountered while attempting to Load WSDL
Definitions for WSDL: 'zip:C:/devapps/weblogicDomain/servers/myserver/tmp/_WL_us
er/_appsdir_brt-service-1.0_war/l2mgsr/war/WEB-INF/lib/_wl_cls_gen.jar!/brt.wsdl
'. Found an un expeced Node #text with name = null and with text content =
at weblogic.wsee.deploy.WSEEModule.prepare(WSEEModule.java:149)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory.prepare(AppDeploym
entExtensionFactory.java:79)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory.access$100(AppDepl
oymentExtensionFactory.java:15)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory$1.prepare(AppDeplo
ymentExtensionFactory.java:219)
at weblogic.application.internal.flow.AppDeploymentExtensionFlow.prepare
(AppDeploymentExtensionFlow.java:23)
Truncated. see log file for complete stacktrace
Caused By: weblogic.wsee.wsdl.WsdlException: Found an un expeced Node #text with
name = null and with text content =
at weblogic.wsee.wsdl.WsdlReader.checkDomElement(WsdlReader.java:106)
at weblogic.wsee.wsdl.internal.WsdlExtensibleImpl.parse(WsdlExtensibleIm
pl.java:114)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parseChild(WsdlDefini
tionsImpl.java:564)
at weblogic.wsee.wsdl.internal.WsdlExtensibleImpl.parse(WsdlExtensibleIm
pl.java:116)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parse(WsdlDefinitions
Impl.java:501)
Truncated. see log file for complete stacktrace

I'm not proud of how long this took me to find. The simple things are so often the hardest.
<wsdl:part name="response" element="beans:changeRequestSubmitRes"/>]
That errant typo'd bracket didn't cause a problem for CXF, but Weblogic, at least at 10.3.6, didn't know what to do with it.

Related

java.lang.RuntimeException: Schema for namespace 'http://ws.abc.com/' already contains type

I am getting error while creating SOAP request.
21 May 2018 18:28:20,791 [Worker[3]] INFO [EndpointDescriptionImpl] [1111907bbb5ef75aNTQwZDM5Y2UxNTYxYzY1Mzc2MGJlM2ViOWUxYjNjMzA.] Building AxisService from wsdl: file: /tmp/unpacked_1526941165474/META-INF/wsdl/WS11_WSDL.wsdl 21 May 2018 18:28:20,792 [Worker[3]] ERROR [WSDL11ToAxisServiceBuilder] [1111907bbb5ef75aNTQwZDM5Y2UxNTYxYzY1Mzc2MGJlM2ViOWUxYjNjMzA.] Schema for namespace 'http://ws.abc.com/' already contains type 'doLoginResponse java.lang.RuntimeException: Schema for namespace 'http://ws.abc.com/' already contains type 'doLoginResponse
at org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:311)
at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:158)
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:347)
at org.apache.axis2.description.WSDLToAxisServiceBuilder.getXMLSchema(WSDLToAxisServiceBuilder.java:140)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.copyExtensibleElements(WSDL11ToAxisServiceBuilder.java:2186)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:306)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processTypes(WSDL11ToAxisServiceBuilder.java:297)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:265)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.buildAxisServiceFromWSDL(EndpointDescriptionImpl.java:789)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxisService(EndpointDescriptionImpl.java:651)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(EndpointDescriptionImpl.java:216)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init>(EndpointDescriptionImpl.java:181)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndpointDescription(ServiceDescriptionImpl.java:296)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndpoint(DescriptionFactoryImpl.java:268)
at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(DescriptionFactory.java:96)
at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:233)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.alestra.ws.AddressWebService_Service.getAddressWebServicePort(AddressWebService_Service.java:51)
Can anyone suggest ?
Using java 1.6 and axis2 jars.
I also observered that in one system same code is working fine but in other code is getting this issue. I think this is not coding issue, may be some jar or other issue but not sure.

Pass argument via JNLP file into java web start application

I'm beginner in Java programming, and I'm trying to make Java Web Start app. I need to pass some args to application, trough JNLP. When I hardcode values in web app, JNLP without args works fine, and start application. Also, when launch application from cmd with arguments, it's working. So I think that problem is in the JNLP file. When I try to launch app with JNLP that contains arguments, start failed with error:
java.lang.ArrayIndexOutOfBoundsException: 0
JNLP file looks like:
<application-desc main-class="SpeedScanLaunch" >
<argument>http://localhost/TestApp/Dam/</argument >
<argument>x</argument >
<argument>50004</argument >
</application-desc >
and Java class looks like:
import java.io.*;
import javax.swing.JOptionPane;
public class SpeedScanLaunch
{
public static void main(String args[])throws IOException
{ String p = args[0];
String t = "/type:" + args[1];
String id = "/id:" + args[2];
JOptionPane.showMessageDialog(null, p);
JOptionPane.showMessageDialog(null, t);
JOptionPane.showMessageDialog(null, id);
...
Does anyone know what the problem with JNLP is?
In addition, screnn freom JaNeLa:
Screenshot from janela
And text report from JaNeLa:
JaNeLA Report - version 11.05.17
Report for file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp
Content type application/xml does not equal expected type of application/x-java-jnlp-file
cvc-complex-type.2.4.d: Invalid content was found starting with element 'security'. No child element is expected at this point.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'security'. No child element is expected at this point.
XML encoding not known, but declared as utf-8
Codebase '.' is a malformed URL! Defaulting to file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp
Codebase + href 'file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch.jnlp' is not equal to actual location of 'file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp'.
Optimize this application for off-line use by adding the <offline-allowed /> flag.
Codebase '.' is a malformed URL! Defaulting to file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp
Codebase '.' is a malformed URL! Defaulting to file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp
Codebase '.' is a malformed URL! Defaulting to file:/E:/eclipse_workspace/TestProjekt/bin/SpeedScanLaunch1.jnlp
Downloads can be optimized by specifying a resource size for 'SpeedScanLaunch.jar'.
The resource download at SpeedScanLaunch.jar can be optimized by removing the (default) value of download='eager'.
The resource download at SpeedScanLaunch.jar can be optimized by removing the (default) value of main='false'.
It might be possible to optimize the start-up of the app. by specifying download='lazy' for the SpeedScanLaunch.jar resource.
Lazy downloads might not work as expected for SpeedScanLaunch.jar unless the download 'part' is specified.

java.lang.NoSuchMethodError when sending mail using Apache James 3

I just downloaded and setup the Apache James 3 latest beta release on Windows and so far i haven't been able to send a simple message. It looks like there is an issue with the build. The error is -
ERROR 22:45:01,666 | james.mailspooler | Exception processing mail while spooling Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl#4262d5d7])
javax.mail.MessagingException: Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl#4262d5d7])
.
.
Caused by: javax.mail.MessagingException: Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl#4262d5d7])
.
.
Caused by: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl#4262d5d7]
.
.
Caused by: java.lang.NoSuchMethodError: org.apache.james.mime4j.stream.MimeConfig: method <init>()V not found
The relevant class in the JAR shows the supposedly missing constructor so i am at a complete loss. Can anyone guide me in the right direction please?
Thanks in advance!
Edit: Decompiled code snippet from the MimeConfig class shows the constructor
public final class MimeConfig {
/* member class not found */
class Builder {}
.
.
MimeConfig(boolean strictParsing, int maxLineLen, int maxHeaderCount, int maxHeaderLen, long maxContentLen, boolean countLineNumbers,
String headlessParsing, boolean malformedHeaderStartsBody) {
/* 53*/ this.strictParsing = strictParsing;
/* 54*/ this.countLineNumbers = countLineNumbers;
/* 55*/ this.malformedHeaderStartsBody = malformedHeaderStartsBody;
/* 56*/ this.maxLineLen = maxLineLen;
/* 57*/ this.maxHeaderCount = maxHeaderCount;
/* 58*/ this.maxHeaderLen = maxHeaderLen;
/* 59*/ this.maxContentLen = maxContentLen;
/* 60*/ this.headlessParsing = headlessParsing;
}
I got the same error and was searching for an answer. The error is because MimeConfig doesn't have a default constructor. I could get the mail successfully delivered locally by doing to following.
Dowloaded apache-mime4j-core-0.8.0-20150617.024907-738-sources
Created a default public constructor for MimeConfig
Initialized all the variables with values shown in the static class Builder constructor
Added setters for all the variables (Because I was getting NoSuchMethodError for setMaxLineLen)
Created a jar called apache-mime4j-0.8.0-fix.jar and pushed into the lib folder
I use run.sh, so replaced the mime4j core jar name with the above one.
I am sure there is some mismatch between spooler and mime4j. I think the calling code should use the Builder instead of directly trying to instantiate the MimeConfig.
Try these and let me know if it works. It worked for me. I am not sure if this is a permanent fix, but I can go ahead with exploring the V3 features till we get a permanent solution.
The solution is to use the : apache-mime4j-core-0.7.2.jar and apache-mime4j-dom-0.7.2.jar
download the two jars and put them in : james-server-app-3.0.0-beta5-SNAPSHOT\lib.
You can download james-server-app-3.0.0-beta5 from : https://repository.apache.org/content/repositories/snapshots/org/apache/james/james-server-app/3.0.0-beta5-SNAPSHOT/.

Getting UnmatchedTypeException while converting wsdl to java

I am trying to convert the wdsl to java by using axis2 script wsdl2java.sh and getting the following exception
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: org.apache.axis2.wsdl.codegen.CodeGenerationException: org.apache.axis2.wsdl.databinding.UnmatchedTypeException: No type was mapped to the name OTRS_SessionCreate with namespace http://172.22.1.76/TicketConnector/
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException: org.apache.axis2.wsdl.databinding.UnmatchedTypeException: No type was mapped to the name OTRS_SessionCreate with namespace http://172.22.1.76/TicketConnector/
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:537)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:282)
... 2 more
Caused by: org.apache.axis2.wsdl.databinding.UnmatchedTypeException: No type was mapped to the name OTRS_SessionCreate with namespace http://172.22.1.76/TicketConnector/
at org.apache.axis2.wsdl.databinding.TypeMappingAdapter.getTypeMappingName(TypeMappingAdapter.java:82)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputParamElement(AxisServiceBasedMultiLanguageEmitter.java:3011)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputElement(AxisServiceBasedMultiLanguageEmitter.java:2793)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:2358)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:2242)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForCallbackHandler(AxisServiceBasedMultiLanguageEmitter.java:1232)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeCallBackHandlers(AxisServiceBasedMultiLanguageEmitter.java:1198)
at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:500)
... 3 more
and the following is the wsdl file ,please guys really need help at this one trying to integrate otrs ,using this file for generating the stubs
plase do help me in this
thanks

XML validation error message always display

I am a Java developer. I'm working with a legacy system which is using Strtus1.2.9. After I added some jar file to this system and started the Tomcat, some error message display in the console. It seems like some of old xml file can not pass the parse. The tracback is like the following:
ERROR - Digester.error(1463) | Parse Error at line 396 column 35: Element type "var-value" must be declared.
org.xml.sax.SAXParseException: Element type "var-value" must be declared.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1171)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at org.apache.commons.digester.Digester.parse(Digester.java:1591)
at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
It seems like some xml has DTD version compatible issue. Why this error never display before. I just add these new jar files:
antlr-runtime-3.1.3.jar
drools-api-5.1.0.jar
drools-compiler-5.1.0.jar
drools-core-5.1.0.jar
drools-decisiontables-5.1.0.jar
drools-templates-5.1.0.jar
flatworm-2.0.1.jar
freemarker.jar
jxl-2.6.10.jar
jxls-reader-0.9.6.jar
mvel2-2.0.16.jar
xml-apis.jar

Categories