Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PDF to .Doc or Docx converter by core java using standard JDK

661723Oct 3 2011 — edited Oct 5 2011
Hi

is it possible to convert a PDF file to .doc and .docx by standard JDK or JRE library without using any thirdparty library?if it is can anyone give me any pointer class reference to start the thing.I need core JAVA function who will simply accept a .pdf file and convert it to .doc.

kind regards

Edited by: no one on Oct 3, 2011 12:17 AM

Edited by: EJP on 3/10/2011 16:20: typos/spelling errors
This post has been answered by gimbal2 on Oct 3 2011
Jump to Answer

Comments

582987
When the server gets to this state, I am unable to register any ESB Projects from JDeveloper. I get the following error:


error code: 0 : 10
summary: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.NullPointerException
at oracle.tip.esb.console.XMLConsoleManagerImpl.commit(Unknown Source)
at oracle.tip.esb.configuration.deployment.JDevDeploymentManager.deploy(Unknown Source)
at oracle.tip.esb.configuration.deployment.DeploymentServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
".
Fix: -
582987
I've since changed my oc4j-ra.xml to the following (now using proper connector-name) and now I get no errors... but I don't seem to be receiving any messages either. Any ideas on the best way to unit test a JMSAdapter set to consume messages?

<connector-factory location="eis/activeMQ/Topic" connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation" value="ConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory; java.naming.provider.url=tcp://se01:61616"/>
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="false"/>
<config-property name="username" value="oc4jadmin"/>
<config-property name="password" value="oc4jadmin"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
525992
Hi,

Interesting in deed. It's on my plate to try it out. You are couple of steps ahead of me...:-)
Can't offer much help at this point..but have you looked into the following article about configuring ActiveMQ resourse adapter in 10gAS

http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-use-activemq-JCA-RA/doc/how-to-use-activemq-JCA-RA.html

Are you configuring as third-party or JCA+JMS provider from JMS adapter wizard?

Regards,
Rajesh
582987
Hi Rajesh,
I did use those instructions to build the ActiveMQ rar and deploy the shared library into my server.

I am using the adapter wizard which references the custom Jms Adapter connector factory I added in my oc4j-ra.xml.

Any ideas on how best to unit test a JMS consumer in Oracle SOA Suite (specifically, esb-dt in the OC4J server).

How do I configure as a separate third party? Does that mean I create my own adapter from scratch? That would seem to be more difficult?
582987
I've distilled down all my steps to 2 simple configuration steps to deploy the activemq client jar into the server, and attempt a topic subscription.

1) deploy the activemq client jar by modifying the library path entry in application.xml at %ORACLE_HOME%\j2ee\home\config to have the following:

<library path="../../home/lib/scheduler.jar;C:\incubator-activemq-4.0.1\lib\activemq-core-4.0.1.jar"/>

(add the activemq client jar at the end).

2) modify oc4j-ra.xml for the JMS Adapter (add an entry for ActiveMQ/Topic) at
C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\application-deployments\default\jmsadapter:

<connector-factory location="eis/activeMQ/Topic" connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation" value="ConnectionFactory"/>
<config-property name="factoryProperties" value="java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory;java.naming.provider.url=tcp://achan-lap:61616;topic.MyTopic=topic.event.publication;connectionFactoryNames=ConnectionFactory"/>
<config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="false"/>
<config-property name="username" value=""/>
<config-property name="password" value=""/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>

With those two configurations, you can then use the JMSAdapter component from within JDeveloper, deploy it to the remote Oracle SOA instance, and start it with no errors.

This is now what I see in my log.xml:
<PAYLOAD>
<MSG_TEXT>Successfully finished endpoint activation for operation "PS01-DSB.PurismaJMSIn_RS.Consume_Message".</MSG_TEXT>
</PAYLOAD>

Now however, I get no output in my filewriter! I did make sure to put in an expression and a mapping in my routing service, but I still don't get any output when I put a message on my topic. Does anyone else have any ideas???
582987
Anyone have any ideas on this? Still stuck
518653
I set up an ActiveMQ connection a couple of months ago (not sure which version though). It was a simple BPEL process, set up to publish a message to a queue. If you could try to do this, and it works, we eliminate a few options :-)

I do not currently have access to the environment where I did it, but if I remember correctly:

- I copied the ActiveMQ .jar files to the $SOA_HOME/j2ee/oc4j_soa/applib directory (and restarted the appserver)

- Then I created an entry in the oc4j-ra.xml file, similar to the one you describe

After that, all I had to do was set up the JMS adapter using the wizard and the EIS JNDI name.

(In addition, I remember there was a version mismatch with the apache commons logger used by ActiveMQ and SOA Suite, but after I replaced both jar-files with the latest version, that problem went away too. But that could have been a problem only in that particular case).
582987
Yes I was able to get BPEL working just last night! I happened to use the same exact steps you laid out. I wish you had posted earlier... none of this is really well documented.

Now I'm trying to get durable subscribers working.

ESB seems to be a bit more problematic than BPEL (no errors and yet no messages)

Another question for you, since this isn't really well documented at all... is it necessary to enter in the JNDI values in the wizard as well as in the oc4j-ra.xml text file? I don't think the wizard entries are used at all (I had to enter the clientID for my durable subscriber in the .xml, and yet when I entered it in the wizard I was getting errors in my log that no clientID was specified)

What exactly is needed in the wizard, and what is needed in the oc4j-ra.xml file. Can I get it to work by just inputting the reference to the EIS connection in the wizard, and put all my JNDI values in the oc4j-ra.xml file, and leave the rest of the JNDI entries in the wizard blank?
518653
Ah, that's too bad, I'm sorry I didn't notice the thread before. :-)

Anyway, the way the process picks up parameters from the oc4j-ra vs the wizard works is something like this:

- If there is an EIS reference, read oc4j-ra.xml, see if there is a match with the EIS JNDI. If there is a match, use this EIS.
- If there is no EIS reference or RA match, read the mcf properties from the WSDL (i.e. what you enter in the wizard)

(This approach is documented in the Oracle® Application Server Adapters for Files, FTP, Databases, and Enterprise Messaging - User’s Guide: Figure 4-71)

So the answer to your question is yes, as long as you are not using the connection in JDeveloper to discover information about queues etc, it is OK to just use the JNDI.

Cheers,
Rune
582987
Ah yes. I didn't know to check the database adapter docs for information on when the oc4j-ra.xml file kicks in :)

Another question, is there a recommended way to swap out a shared system library (e.g., apache.commons.logging) The way I did it was a pure hack - I just replaced the commons-logging.jar with the updated one. I didn't see a way to do it from the admin console.
518653
I'm sure you mean the Enterprise Messaging docs ;-)

About the library swap... To be quite honest, I don't know, I just did the same thing you did.
Maybe someone else could share some wisdom on this issue?
582987
What JMS Connection JNDI name do I use if I don't want to refer to an entry in the oc4j-ra.xml file? I cannot leave this blank in the .wsdl wizard (the next button is greyed out). I thought if I left it blank it would use the entries I entered in the wizard.

And yes I meant the database adapter docs... try googling "User’s Guide: Figure 4-71 oc4j-ra.xml" and tell me what you find :)
518653
Try using "eis/JMS/Doesnotreallyexist". Or something like that.
As long as it does not exist in the oc4j-ra.xml, it will fall back on the mcf properties.

Btw, chapter 4 is definitely about databases. :-)

Cheers,
Rune
1 - 13
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 2 2011
Added on Oct 3 2011
6 comments
1,527 views