I had to use axis to generate stubs because the SOAP I am working with uses RPC. After setting up the code to post I am receiving the below stack trace. If anyone has had this issue please help. From using the debug tool in Eclipse I can see that Axis is using default prefixes, but the issue is that one of the prefixes it uses has already been used so it returns null. Does anyone know why this may be happening?
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: java.io.IOException: Non nillable element 'prefix' is null.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: java.io.IOException: Non nillable element 'prefix' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.outputMultiRefs(SerializationContext.java:1055)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:145)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.client.Call.invoke(Call.java:2757)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
Though that this question is not answered after one year I thought that it might help you since you are working with RPC and probably a legacy system.
In your generated client stub with Apache Axis under packaging that ends with "_xsd" where the Objects of the web service provider are created open classes one by one.
Somewhere in the middle of the class you will find a static block code like this:
static {
typeDesc.setXmlType(...);
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("prefix");
elemField.setXmlName(new javax.xml.namespace.QName("", "prefix"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
just change the value of nillable to true like this:
elemField.setNillable(true);
You should repeat this action for all classes and all fields of those classes if they do not match with their corresponding values in your WSDL (i.e. based on the definition of your WSDL they are nullable).
I've noticed that Apache Axis 1.2 - 1.4 automatically makes attributes not 'nillable' by default. I don't know why is this the case but I think this is the solution.
Related
im using
integration toolkit for each external system ... externalService
definition, Servers registation datas, ENV refers the J2C creds to use, datamapping, bussines-errors handling etc.
(Bussines-Layer TK ex. TK_SAP)
for the common functionality such as logging, tokenizing,
pseudomizing, common http-error handling i want to use another one
toolkit (Generic implementation for Transport-layer ex. TK_COM).
So its looks like this dependicies chain:
ProcessApp -> TK_SAP -> TK_COM
There is the serviceFlow with inputs externalServiceName, operationName and a serviceFlow ask for oAuth-token and call to target system using externalServiceName, operationName.
The problem is - when i try to invoke the BPMRESTRequest from TK_COM, i get NullPointerException because "externalServiceName" cant be resolved.
var request = new BPMRESTRequest();
request.externalServiceName = "language-translator-v2";
request.operationName="checkout";
...
var response = tw.system.invokeREST(request);
is it possible to store service definition in another TK (upper) and refer it from Toolkit-invoker?
Or is there callbacks for BPMRESTRequest-Construct to say which ServiceDefinition must be used and avoid NPE.
Or another way to call Rest programmaticaly supporting Environments.
Im understand that switching the layers can help (serviceDefinition in lower TK-dependency), but it unlogisch is:
ProcessApp -> TK_COM -> TK_SAP
the answer is: JS-lib implementation.
Implementing common functionality as JS-Server-file in TK_COM makes that a call to it from TK_SAP will instatiate JS-execution context in the TK_SAP namespace so all defined in TK_SAP externalServices and variables will be accesible by executing of JS-code (actualy provided by lower-dependency Toolkit)
I'm trying to use my application with following code in JPS
<c:forEach var="area" items="#{MissingSearchBean.workingAreas}">
<h:commandButton value="#{area.workingAreaName}(#{area.count})"
action="#{MissingSearchBean.selectWorkingArea(area.workingAreaName)}"
styleClass="commandButton" />
</c:forEach>
inside wilfly 10. Everything works fine, but when I open view, containing code above I see following error in logs:
Caused by: org.infinispan.commons.marshall.NotSerializableException: javax.servlet.jsp.jstl.core.IteratedExpression
Caused by: an exception which occurred:
in field iteratedExpression
in field delegate
in field savedState
in field m
in object java.util.HashMap#85e645ff
in object org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValue#85e645ff
I think that wildfly tries to persist view into infinispan to be able to recover view in case if I'll reload page or hit this page on another node.
I've tried to change scope of bean to request and even to none, but wildfly still tries to serialize view. I'm absolutely sure that the problem is in c:forEach because when I comment it (ot its' content) out — I don't get any exceptions.
Also obviously IteratedExpression contains Iterator inside, which is not Serializable true.
I'm looking for any solution/workaround for this be able to work in cluster without throwing exceptions.
The problem is c:forEach creates IteratedValueExpression, which is not Serializable because contains the Iterator inside. Simple workaround for this is to change return type of MissingSearchBean.workingAreas to array.
In case when value is represented by array, LoopTagSupport creates IndexedValueExpression instead of IteratedValueExpression and this is explicitly Serializable.
Using grails mail plugin 1.0.7.
https://jira.grails.org/browse/GPMAIL-36 states that it's possible to change plguin configuration since 1.0.1 at runtime. Sadly it does not explains how to achieve it.
I want to be able to change the username at runtime to be able to use different mail accounts.
Thanks.
Based on this code, you should be able to change the configuration at runtime and the mail plugin will automagically re-deploy and update mail sender based on your changes.
Example:
Holders.config.grails.mail.username = 'foo'
Holders.config.grails.mail.password = 'bar'
sendMail {
to "foo#bar.com"
from "bar#foo.com"
subject "Hi"
body "This is an email"
}
Update:
It would appear that changing the configuration in this manner does not, in fact, fire the onConfigChange event. Per this, you can fire the event manually. Something like this:
Holders.pluginManager.getGrailsPlugin('mail').notifyOfEvent(GrailsPlugin.EVENT_ON_CONFIG_CHANGE, Holders.config)
I've realized this can be done accessing the mailSender bean from the context and updating it like is explained here
Changing mail configuration in runtime
However if #rmlan solution finally works it may be a much cleaner solution.
Actually thr rmlan solution works with the following fix. Since the onConfigChange compares hashCode of existing config map and new one, so if you set new configs in original configuration (Holders.config.grails.mail), then both configs are same and it never pass the condition to apply new changes, so a new structure should be created and pass it to notifyOfEvent method to mark the change as different hashCodes.
def mailConfig = [ grails: [ mail: [:] ] ]
mailConfig.grails.mail.host = newHost
mailConfig.grails.mail.port = newPort
Holders.pluginManager.getGrailsPlugin('mail').
notifyOfEvent(GrailsPlugin.EVENT_ON_CONFIG_CHANGE, mailConfig)
Still using async-mail and this one make the below exception
No qualifying bean of type [grails.plugin.mail.MailService] is defined: expected single matching bean but found 2: nonAsynchronousMailService,mailService
that is thrown because of the following part of onConfigChange
event.ctx.getBean(MailService.class).setPoolSize(mailConfig.poolSize?:null)
Commenting it let it works as a workaround, but making sendMail of mail plugin is called, not async-mail, so exception may raise if async-mail features is used on constructing mail. Hence to use async-mail in this workaround should use sendAsynchronousMail method.
I have been sitting with a problem for quite a while now and I just can't seem to find what I'm missing.
I have written a custom trace listener component for Enterprise Library 5.0 for the Logging application block which works but the configured ILogFormatter just won't resolve and so I always end up with the basic string text when it gets handled by my component.
I saw in the enterprise library source code that they use the "Container.ResolvedIfNotNull()" method. It doesn't seem to work for me. I need it to write out a custom formatted string for my component to use. You know, not just the message but the timestamp, machinename, threadId, etc.
Does anyone have any ideas on how to fix this?
Thanks in advance.
Like I've mentioned on this site: http://entlib.codeplex.com/discussions/261749
When you create your CreationExpression in the TraceListener data class make sure you have a flat constructor definition. To put it in other words, don't return:
() => new MyTraceListener(new TraceListenerConfig(..., Container.ResolvedIfNotNull<ILogFormatter>(), ...));
just have it in the constructor of the MyTraceListener:
() => new MyTraceListener(..., Container.ResolvedIfNotNull<ILogFormatter>(), ...);
I am getting following error on console when using open jpa.What may be the possible cause?I cant post the code as its against my company policies.
[12/31/10 14:54:13:279 GMT+05:30] 00000063 MetaData W CWWJP9991W: openjpa.MetaData: Warn: OpenJPA cannot map field "abc.xyz" efficiently. It is of an unsupported type. The field value will be serialized to a BLOB by default.
[12/31/10 14:54:13:295 GMT+05:30] 00000063 MetaData W CWWJP9991W: openjpa.MetaData: Warn: The class "pqr.xyz" listed in the openjpa.MetaDataFactory configuration property could not be loaded; ignoring.
[12/31/10 14:54:13:295 GMT+05:30] 00000063 MetaData W CWWJP9991W: openjpa.MetaData: Warn: OpenJPA cannot map field "pqr.xyz" efficiently. It is of an unsupported type. The field value will be serialized to a BLOB by default.
Failed to create Bundle in DB:
<openjpa-1.2.2-SNAPSHOT-r422266:778978M-OPENJPA-975 fatal user error> org.apache.openjpa.persistence.ArgumentException: Field "abc.xyz" cannot declare that it is mapped by another field. Its mapping strategy (org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy) does not support mapping by another field.
at org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy.assertNotMappedBy(AbstractFieldStrategy.java:59)
at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.map(HandlerFieldStrategy.java:71)
at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:879)
at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:339)
at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:662)
at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:549)
at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:363)
at org.apache.openjpa.kernel.QueryImpl.classForName(QueryImpl.java:1569)
at org.apache.openjpa.kernel.ExpressionStoreQuery$1.classForName(ExpressionStoreQuery.java:108)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:168)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:139)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:225)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:195)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:188)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$600(JPQLExpressionBuilder.java:69)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1756)
at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:56)
at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:153)
at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:658)
at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:639)
at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:605)
at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:667)
at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:574)
at com.xyz.ws.persistence.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:105)
at com.xyz.ws.persistence.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:37)
at com.xyz.ws.jpa.management.JPATxEmInvocation.createNamedQuery(JPATxEmInvocation.java:116)
at com.xyz.ws.jpa.management.JPAEntityManager.createNamedQuery(JPAEntityManager.java:302)
I just solved an error like this. The error was quite misleading. The problem was I forgot to put the entity into the persistence.xml file.
I was having the same problem.
The message is not clear!
What solved my problem was implementing equals() and hashCode() in the entity object and its pk object.
Also see if the class is declared inside the persistence.xml
Hope it helps someone.
I'm going to guess (best I can do without seeing code) that you have a relationship to another class that you have failed to annotate with #ManyToOne, #OneToMany or similar.