JAXB runtime ClassNotFoundException

I'm trying to set up some really basic build stuff using ant and JAXB to handle the transforming of some XML data, but I'm having some trouble getting it to not throw exceptions at runtime. I've successfully got an XJC task running in ant that is definitely outputting all the correct java classes, and they compile without an issue.
The problems occur when I either try to unmarshall or marshall any data using a JAXBContext. basically, my code looks something like this:
public class Deserializer<T>
     private JAXBContext m_context;
     private Unmarshaller m_unmarshaller;
     public Deserializer(String contextPath)
          try
               JAXBContext m_context = JAXBContext.newInstance(contextPath);
               Unmarshaller m_unmarshaller = m_context.createUnmarshaller();
          catch (JAXBException e)
               System.out.println(e);
     public T deserialize(File xml)
          try
               return (T)m_unmarshaller.unmarshal(new FileInputStream(xml));
          catch (FileNotFoundException e)
               System.out.println(e);
          catch (IOException e)
               System.out.println(e);
          catch (JAXBException e)
               System.out.println(e);
          return null;
}and the exception that I am seeing when the unmarshal function is called is this:
[java] Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
     [java]      at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:137)
     [java]      at com.sun.xml.bind.DatatypeConverterImpl.<clinit>(DatatypeConverterImpl.java:740)
     [java]      ... 39 more
     [java] Caused by: java.lang.ClassNotFoundException: org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl
     [java]      at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
     [java]      at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
     [java]      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1094)
     [java]      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
     [java]      at javax.xml.datatype.FactoryFinder.getProviderClass(FactoryFinder.java:115)
     [java]      at javax.xml.datatype.FactoryFinder.newInstance(FactoryFinder.java:146)
     [java]      at javax.xml.datatype.FactoryFinder.findJarServiceProvider(FactoryFinder.java:298)
     [java]      at javax.xml.datatype.FactoryFinder.find(FactoryFinder.java:223)
     [java]      at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:131)
     [java]      ... 40 morewhich looks like maybe my classpath might be wrong? im really not sure. Ive tried downloading xerces .jar's and pointing the classpath at that, with identical results. For reference, I'm not using any IDE's, just good old vim on a fresh mac running snow leopard.
Any help at all would be greatly appreciated.
Thanks,
s.

This is the ant code im using:
     <java classname="testjaxb.testjaxbCLI">
            <classpath>
               <pathelement path="${basedir}/tools/testjaxb/build" />
               <fileset dir="${lib.dir}/commons-cli-1.2"/>
               <fileset dir="${lib.dir}/jaxb"/>
            </classpath>
     </java>The buid directory is where all class files from the compilation stage (both my stuff and the stuff generated by xjc) are dumped. The commons-cli-1.2 directory is for apache commandline parsing classes. the jaxb directory contains these jars (just in case i'm missing one for some reason):
activation.jar
jaxb-impl.jar
jaxb-xjc.jar     
jaxb1-impl.jar
jaxb-api.jar
jsr173_1.0_api.jar
s

Similar Messages

  • JAXB Runtime Error

    have generated the java files using jaxb (jwsdp1.6) from schema. I am using Jdeveloper 10.1.3. It throws a runtime error which is as follows:
    [-] 2006-04-24 17:12:10,617 ERROR ProcessBatchEJB::getBatchJob - Provider com.sun.xml.bind.ContextFactory_1_0_1 could not be instantiated: java.lang.ClassCastException
    06/04/24 17:12:10 java.lang.ClassCastException
    06/04/24 17:12:10 at com.sun.xml.bind.ContextFactory_1_0_1.createContext(ContextFactory_1_0_1.java:50)
    Any ideas??

    Make sure that you have put the jar files from Sun's implementation before the version that is embedded in JDeveloper. The ClassCastException may be occuring once you have created a new object instance using Oracle's factory and try to use it with Sun's implementation classes.
    Hope this helps,
    Eric

  • Minimum packaging to deploy JAXB?

    What is the minimum set of jars I should ship to deploy XJC-generated classes?
    I'm trying to decide whether I can use JAXB, and one important factor is deployability. For my project, I can assume that the customer already has Java 1.4, but otherwise the application must be self-contained.
    I cannot ship the entire Web Services Developer Pack: that's far too large and complex for my needs, as I'm not building a web service. All I want is XML <-> Java translation using standardized APIs, and in the case of a known, fixed schema JAXB objects have better programmer convenience and memory efficiency than generic DOM trees.
    Is there an official distribution with a simple "jaxb-runtime.jar" I can use? At the moment, I'm taking individual jars out of the WSDP, trying to find the smallest set that works.
    Here's the minimum set of Jars that seem to work for running XJC generated classes.
    <fileset dir="${jwsdp}/jaxb/lib">
    <include name="jaxb-api.jar"/>
    <include name="jaxb-impl.jar"/>
    <include name="jaxb-libs.jar"/>
    </fileset>
    <fileset dir="${jwsdp}/jwsdp-shared/lib">
    <include name="jax-qname.jar"/>
    <include name="namespace.jar"/>
    <include name="relaxngDatatype.jar"/>
    <include name="xsdlib.jar"/>
    </fileset>
    Notably absent are the jars in jaxp/lib/endorsed. The large "xsdlib.jar" overlaps a lot with xercesImpl, but not enough to use it as a standalone xsd-aware jaxp parser, which I need for other reasons.
    Noteably present is a dependency on Relax NG, which I am not using.
    Unless JAXB packaging improves, I'll be using Xerces-J plus bare DOM. Tell me there's a better way?

    I think we do not have to take the files mentioned in second <fileset/> to the client. At runtime we need:
    jaxb-api.jar, jaxb-ri.jar(jaxb-impl.jar), jaxb-libs.jar, xerces.jar and generated jar for the package. It worked for me.
    Is there an official distribution with a simple
    "jaxb-runtime.jar" I can use? The JAXB system is divided into two main parts that are completely independent.
    1. Generating classes
    2. Creating objects at runtime
    Obviouly first part needs more XML specific jars, but for second part (in which client is interested) we don't need them.
    So there can't be a true "jaxb-runtime.jar".

  • Runtime error - Session cannot be resolved to a type

    Hello! I try to get JavaMail working, but all in vain.
    The problem is I get such an error every time.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved to a type
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)I'm using Eclipse, so I've added external JARs there (activation.jar, mail.jar, mailapi.jar, pop3.jar, smtp.jar). In addition to this, the same libraries are in +/opt/jdk1.6.0_13/jre/lib/+.
    I've imported javax.mail.*, java.util.*, javax.mail.internet.* in my JSP file. I tried to do a lot of manipulations. Also I tried to use different code examples, but the error in the line "Session.getInstance(props, null)" remains the same.
       Properties prop = new Properties();
       prop.put("mail.smtp.host",hostMail);
       prop.put("mail.smtp.user",fromEmail);
       prop.put("mail.smtp.auth","true");
       Session ses =  Session.getInstance(prop,null);The same problem remains when I do this as a Servlet. Class compilation with javac occurs without errors.
    Might the problem be in version compatibility? I use: ArchLinux, Tomcat 5.5, JavaMail 1.4.2.
    Thanks in advance.
    Edited by: Pavel_Z on May 7, 2009 4:55 PM

    Now I am confident that the problem is with library including, as the same thing happens with other libraries.
    I found that such a warning appears every time:
    Classpath entry /jspbook/src/lib/mail.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.Unfortunately, I've no idea how to include this in a proper way. I think that setting it in "Add External JARs" in "Java Build Path" is enough... or not?
    Seems we're close to solve the problem. May be this screen shot will be helpful to determine the problem?
    http://img257.imageshack.us/img257/3967/screenshotjavaeejspbook.png
    You can see that libraries are included in the Project Explorer

  • Jaxb 2 customization issue

    I am new to JAXB2 world.
    -I have a xml document whose xsd has imports of other xsds. I have the corresponding domain model and java objects in hand. The names of the classes/attibutes differ from that of those specified in the xsd; Thus did the jaxb 2.0 customization. JAXB is throwing a nullpointer exception when it encounters the import of other xsd in the calling xsd but works well, otherwise.
    -In the case of complicated java domain models and xml bining, would the usuage of Jibx be preferable over Jaxb...any suggestions?!
    -Also please suggest a good book/articles about java domain and xml binding.
    Any help is highly appreciated.
    Thanks in advance.

    Hello,
    For complicated models, or for situations in which you want to map an existing object model to an existing XML schema you need a tool that goes beyond JAXB.
    I am the team lead for Oracle TopLink Object-to-XML (JAXB) and was a member of the JAXB 2.0 (JSR-222) expert group so I'll share my thoughts.
    - TopLink OXM provides a visual tool, the TopLink Workbench to map an existing XML schema to an existing object model.
    - TopLink OXM can be exposed through the standard JAXB runtime APIs.
    - TopLink OXM can be run with any JAXP compliant parser. Many binding solutions are dependent on a specific parser.
    For more information on TopLink OXM/JAXB
    http://www.oracle.com/technology/products/ias/toplink/oxm/index.html
    My Oracle OpenWorld 2005 presentation
    http://download-west.oracle.com/oowsf2005/1535.pdf
    -Blaise

  • Warning message about ClassNotFoundException in a new web project

    - Eclipse 3.3M6
    - Web Tools Platform 2.0M6
    Hello, everybody!
    I created a Dynamic Web Project using JSF and JPA, but I'm getting the following
    warning message in the Problems view:
    Classpath entry org.eclipse.jdt.USER_LIBRARY/Biblioteca JPA will not be exported or published. Runtime ClassNotFoundExceptions may result.
    This user library, Biblioteca JPA, is composed of this jars:
    antlr-2.7.6.jar
    cglib.jar
    dom4j.jar
    ejb3-persistence.jar
    hibernate3.jar
    hibernate-annotations.jar
    hibernate-entitymanager.jar
    sqljdbc.jar
    jboss-hibernate.jar
    In the project I also have these libraries:
    Biblioteca JSF:
    commons-collections.jar
    jstl.jar
    myfaces-api.jar
    myfaces-impl.jar
    JBoss v4.0:
    jboss-j2ee.jar
    jbossall-client.jar
    javax.servlet.jar
    javax.servlet.jsp.jar
    activation.jar
    mail.jar
    So, I would like to know how do I configure the Bliblioteca JPA to disable possible
    problems with ClassNotFoundExceptions happening at runtime. What do I have to add or
    change on it to get rid of the warning message? Or whatever is the solution that you
    use when this message appear.
    Thank you in advance.
    Marcos

    Hi Deepa,
    >As there is no way where we can upload images directly
    Please provide a link to support this statement.
    And, of course, you can upload images. Have a look [here|Re: Visual composer 7.1 upload the image](at your own thread!)
    Regards,
    Vani V

  • How to add server runtime

    Hi, I created a java project that has util classes. I need to use the HttpSevlet API. So i tried to add weblogic libraries. But it says "Weblogic System Libraries can only be used with projects that target a Weblogic Server runtime". Then I click the Server Runtime, but it's empty. how can I bring in the Weblogic Server runtime? I know I have it since the same project was imported fine. I just want to create a fresh project from the scratch and take the source from the imported proejct. I noticed that in the imported project there is a Oracle Weblogic Portal Server entry. But when I add it, it shows Error: No Oracle Weblogic Server Runtime on project... Thanks!

    Thank you. That's exactly what I am looking for. I thought utility project is just a java project, but now I realize utility is under J2EE. However, utility doesn't have log4j included. I know log4j is in modules under install. what's the good way to add it in? I tried to add as External jar, but I got Classpath Dependency Validator Message error:
    Classpath entry C:/oracle/Middleware/modules/com.bea.core.apache.log4j_1.2.13.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.      
    Also the project eventually needs to be a jar file to be distibuted and I have ant build file to build it already. Can the build be part of the project setup, meaning using the ant build? Thanks!

  • Issue in Excel to XML Conversion

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result.
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

    Thanks Anand,
    PDF shared by you was extremely helpful. Now I have successfully developed and deployed the adapter. But while using it in Communication Channel I am getting following error.
    Error: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/ExcelToXML, cannot resolve object reference. [Root exception is javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: Type: clientAppName Content: sap.com/SAP_Exel_To_XMLEAR Type: interfaceType Content: local Type: ejb-link Content: Excel_To_XML Type: jndi-name Content: ExcelToXML Type: local-home Content: sap.com.excelToXML.Excel_To_XMLLocalHome Type: local Content: sap.com.excelToXML.Excel_To_XMLLocal com.sap.engine.services.ejb3.runtime.impl.refmatcher.EJBResolvingException: Cannot start applicationsap.com/SAP_Exel_To_XMLEAR; nested exception is: java.rmi.RemoteException: [ERROR CODE DPL.DS.6125] Error occurred while starting application locally and wait.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5029] Exception in operation [startApp] with application [sap.com/SAP_Exel_To_XMLEAR]. at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp(DefaultContainerRepository.java:398) at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.getEnterpriseBeanContainer(DefaultContainerRepository.java:182) at com.sap.engine.services.ejb3.runtime.impl.DefaultRemoteObjectFactory.resolveReference(DefaultRemoteObjectFactory.java:55) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:144) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:63) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl._getObjectInstance(ObjectFactoryBuilderImpl.java:76) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl.access$100(ObjectFactoryBuilderImpl.java:33) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl$DispatchObjectFactory.getObjectInstance(ObjectFactoryBuilderImpl.java:226) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:283) at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:434) at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:223) at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:242) at javax.naming.InitialContext.lookup(InitialContext.java:351) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:69) at com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:50) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.getModuleLocal(ModuleProcessorBean.java:419) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:287) at sun.reflect.GeneratedMethodAccessor946.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:74) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at com.sun.proxy.$Proxy3299.process(Unknown Source) at com.sap.aii.adapter.file.File2XI.send(File2XI.java:3605) at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:1374) at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:669) at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:534) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:182) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:280) ]
    pl
    please help

  • Creating a custom java module for excel to xml conversion.

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result. 
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result. 
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

  • Adapter module not including jar file

    Hi all
    Im trying to develop a adapter module but when I add the jar library I get warning saying:
    com.sap.aii.af.cpa.svc.api.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
    Is there a way to fix this problem?

    > Im trying to develop a adapter module but when I add the jar library I get warning saying:
    > com.sap.aii.af.cpa.svc.api.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
    > Is there a way to fix this problem?
    You can ignore it.

  • I am getting this error - JspFormsSession cannot be resolved to a type

    Hi
    I am getting following error when I try to open a jsp file.
    Any solution?
    JSP line details are -
    JspFormsSession openrules_session = (JspFormsSession) session.getAttribute(s_attr);
    Error is -
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    Now I am confident that the problem is with library including, as the same thing happens with other libraries.
    I found that such a warning appears every time:
    Classpath entry /jspbook/src/lib/mail.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.Unfortunately, I've no idea how to include this in a proper way. I think that setting it in "Add External JARs" in "Java Build Path" is enough... or not?
    Seems we're close to solve the problem. May be this screen shot will be helpful to determine the problem?
    http://img257.imageshack.us/img257/3967/screenshotjavaeejspbook.png
    You can see that libraries are included in the Project Explorer

  • XML NameSpace Issue Confused whether it is a bug

    Hi,
    The issue is that the generated XML and Actual XML vary as the following: -
    The namespace which is used in the Actual XML is globally used and whereas In the generated XML It is used locally wherever the corresponding element or type is used in the XML Actually, which should not happen.
    I am confused whether it is a bug or an issue if this is an issue can somebody please suggest me a solution
    Generated XML
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <namespace1:utilAuthenticate xmlns:namespace1="http://NAMESPACE1Services.com">
        <namespace2:ccInfo xmlns:namespace2="http://Namespace2CompanionElements.com">
            <namespace2:UKCreditCard>visa</namespace2:UKCreditCard>
            <namespace2:ccAttributes houseNo="koramangala" cardIssueNumber="321" postCode="533201" cardExpDate="01/01/2006" cardNumber="999999999999998" cardIssueDate="01/01/2005" cv2="123" cardHolderName="murali"/>
        </namespace2:ccInfo>
        <namespace2:ourReference xmlns:namespace2="http://Namespace2CompanionElements.com">reference3</namespace2:ourReference>
    </namespace1:utilAuthenticate>
    Actual XML
    <?xml version="1.0" encoding="UTF-8"?>
    <namespace1:utilAuthenticate xmlns:namespace1="http://NAMESPACE1Services.com"
        xmlns:namespace2="http://Namespace2CompanionElements.com">
        <namespace2:ccInfo>
            <namespace2:UKCreditCard>VISA</namespace2:UKCreditCard>
            <namespace2:ccAttributes cardNumber="4627851535817358"
                cardExpDate="05/08" cardHolderName="testnamecard" cv2="482"
                houseNo="75" postCode="NW1 2PL"/>
        </namespace2:ccInfo>
        <namespace2:ourReference>gm-002025004</namespace2:ourReference>
    </namespace1:utilAuthenticate>The code to give the namespaces is the following line: -
    schemaMarshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",new NamespacePrefixMapperImpl());
    The complete code to Generate the XML is :-
    Marshaller schemaMarshaller = jaxbContext.createMarshaller();
    schemaMarshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",new NamespacePrefixMapperImpl());
    schemaMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    schemaMarshaller.marshal(bizObj, baos);
    NamespacePrefixMapperImpl is the class written by me which should implement the interface NameSpacePrefix (A JAXB Runtime Class)
    And the code for the class is : -
    import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
    class NamespacePrefixMapperImpl extends NamespacePrefixMapper {
         * This method returns prefix for a given namespace uri.
        public String getPreferredPrefix(String namespaceUri, String suggestion,
                boolean requirePrefix) {
            if ("http://gshop.eai.o2c.ibm.com".equals(namespaceUri))
                return "gshop";
            if ("http://Namespace2CompanionElements.com"
                    .equals(namespaceUri))
                return "namespace2";
            if ("http://NAMESPACE1Services.com".equals(namespaceUri))
                return "namespace1";
            if ("http://www.w3.org/2001/XMLSchema".equals(namespaceUri))
                return "xs";
            return suggestion;
        public String[] getPreDeclaredNamespaceUris() {
            return new String[] {};
    }Thanks in Advance for any suggestion.
    Thanks
    Manjith Kumar A.

    Hi Suren7669,
    Welcome to the Support Communities!
    To resolve this issue, I would suggest updating your iOS to the latest, which is 7.0.3.
    iOS 7.0.3
    http://support.apple.com/kb/DL1691
    iOS: How to update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT4623
    Cheers,
    - Judy

  • Java - XML Conversion

    Hi,
    I believe this is possible but cannot determine what Toplink API to use from the documentation. I'd like to convert a simple Java Object (with just standard getter and setter methods) into an XML string IN MEMORY, then from that String, back to the original Java object. No databases involved, no mapping involved. Should be little more than 2 lines of code by my reckoning!
    So does anyone know the API or point me to a code example?
    Thanks
    Mike

    Hi Mike,
    TopLink 10.1.3 introduces object-to-XML mapping support. Similar to relational TopLink, the Mapping Workbench is used to visually map your existing classes (these classes are NOT required to implement any special interfaces or follow any naming conventions) to an existing XML Schema.
    The TopLink OX mappings are XPath based and make use of path and position mechanisms to eliminate the requirement of having a 1-to-1 correspondence between the object model and XML Schema. This limitation is common among code generated O-X tools.
    TopLink OX provides a standard JAXB 1.0 implementation and the JAXB runtime APIs can be used to perform the conversion. TopLink also provides its own conversion APIs that provide additional functionality. In your example you would marshal your objects to a java.io.StringWriter, and unmarshal it from a java.io.StringReader.
    TopLink's OX support does not involve a database, but you can combine it with TopLink's persistence layer to access data sources that accept XML records.
    TopLink 10.1.3 Developer Preview release notes - Object-XML (OX) Support
    http://www.oracle.com/technology/products/ias/toplink/preview/relnotes/tl_relnotes.htm#BABGEIID
    Example Code - Using TopLink OX to implement a custom serializer/deserializer
    http://www.oracle.com/technology/products/ias/toplink/preview/howto/websrv/index.htm
    -Blaise

  • Not able to export file as .war to webapps in tomcat home

    Below is my first servlet program:
    FirstServlet.java:
    package edu.aspire;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.Servlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    public class FirstServlet implements Servlet {
      static {
      System.out.println("Loading Servlet");
      public FirstServlet() {
      System.out.println("Instantiating Servlet");
      public void init(ServletConfig config) throws ServletException {
      System.out.println("Initializing Servlet");
      public void destroy() {
      System.out.println("Removing Servlet from the Servlet container");
      public ServletConfig getServletConfig() {
      return null;
      public String getServletInfo() {
      return null;
      public void service(ServletRequest request, ServletResponse response)
      throws ServletException, IOException {
      System.out.println("service() method");
      PrintWriter out = response.getWriter();
      out.println("Hello World!");
    web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <servlet>
        <servlet-name>aspire</servlet-name>
        <servlet-class>edu.aspire.FirstServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>aspire</servlet-name>
        <url-pattern>/first</url-pattern>
      </servlet-mapping>
    </web-app>
    Deployement:
    To deploy my project into %TOMCAT_HOME%\webapps folder.
    Right click on Project ->Export-> War File
    Project Name: Hello
    Destination: D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Hello.war
    Result found in web browser:
    HTTP Status 404 - /Hello/first
    And Hello.war file is not found in webapps folder too after exporting as .war.
    I am using Apache tomcat 6.0.37, eclipse 3.7.2 release, tomcat plugin :com.sysdeo.eclipse.tomcat_3.3.0
    Please let me know where i am going wrong.

    I have done all those settings but still read the 'Eclipse tomcat run time' and repeated the settings accordingly. Still not not getting output.
    -I exported the file to destination webapps folder and clicked 'finish'
    -when i select 'run on server'
    -the tomcat gets started and 'http status 404' page is displayed in browser
    I even tried this
    - manaully started server
    -exported as .war file to webapps but  does not get exported, doesnt get deployed and nothing gets displayed in the console
    -when provide the link the same page is displayed
    One alert message is displayed in the markers 'Classpath entry C:/Program Files/Apache Software Foundation/Tomcat 6.0/lib/servlet-api.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.'
    I have added servlet-api.jar to the library but still getting this message so tried to adding in classpath (as provided in websites) that also didnt work.
    Next what to do i dont understand.

  • Package level XmlJavaTypeAdapter annotation

    Hi all,
    I have to write a JAX-WS WebService which uses interface types as parameters and return values. Everything works fine if I annotate my interface with a type adapter:
    package com.acme.jaxws.server;
    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
    @XmlJavaTypeAdapter(SimpleAdapter.class)
    public interface Simple {
        String getDummy();
    }However, if I use a package level annotation in package-info.java instead,
    @XmlJavaTypeAdapter(value=SimpleAdapter.class,type=Simple.class)
    package com.acme.jaxws.server;
    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;I get a runtime exception "com.acme.jaxws.server.Simple is an interface, and JAXB can't handle interfaces."
    package-info.java is correctly compiled and deployed.
    The portable artifacts generated with apt are identical, even without an annotation at all.
    I tried Apache cxf with Java 6 as well as Metro with Java 1.5, the exception is the same. So it looks like a JAXB runtime issue.
    Why does JAXB not consider my package level XmlJavaTypeAdapter annotation?
    My actual usecase is to pass objects of a library interface. So I have no access to the source code, and thus annotating the interface itself is no option.
    Thanks,
    Rolf
    Edited by: watermann on Sep 22, 2008 8:34 AM

    http://javaboutique.webdeveloper.com/tutorials/annotation/index-2.html
    http://www.onjava.com/pub/a/onjava/2004/04/21/declarative.html?page=last

Maybe you are looking for

  • ASSET HISTORY SHEET

    Hi,   Can any one give me info on the fields APC FY start, Retirement , Aquisition of standard report asset history sheet(S_ALR_8701190). I want to know about the table names where I can find them or their derivations. Thanks in Advance! Raju

  • Support for Canon 5D Raw

    Okay, this is weird. Just got Aperture 3 on trial and ordered my upgrade. Should be here next week. I find it strange that Aperture 2 has no problem processing the Canon 5D Mark II Raw images but Aperture cannot?!? What the funk is that about? I chec

  • Lost WAN Connection Three Times in Past Two Weeks

    For the third time in the past two weeks, I had to call the support line and walk through the process of having my WAN connection reset after losing my connection to the Internet.  Restarting the router after waiting a minute does not resolve the iss

  • What is your boot time of your Mac?

    I bought a brand new Mac mini (2.26 GHz model with Snow Leopard). I think my system's boot time takes long (from pushing power button to the Log In screen). I see gray(white) blank screen for about 40 secs after turning on Mac. Then Apple logo shows

  • Tomcat in eclipse

    How could i run the tomcat in eclipse?