Java- GWT Client class file changes not reflecting when deployed through WAS - java

I have some GWT RPC Client files and I will compile them in Eclipse and want to replace these client class files in WebSphere. But When I compile in Eclipse, multiple class file will be generated for single source file like $file1.class, $file1.class for file1.java. And in deployment folder of WebSphere when I replace all these files changes are not refelcting even after restarting the server.
Thanks

Related

Access resource files like xml inside jar after deployed on pivotal cloud foundry

I created one java micro service using spring boot. The application requires some data from static xml files (kept together in a folder, lets name it X) in src/main/resources folder.(I am using STS IDE)
It is working fine when I run it in the IDE itself.
Now when I pack it in a jar and try running it using CLI (java -jar jarFileName.jar) it works and access the folder X from the target/classes folder.
Now my problem is, when I try to deploy this small app on Pivotal Cloud Foundry using either CLI or STS plugin, I have to give a path to the jar file so it uploads only the respective jar file and starts the container with the application. But the application cannot access folder X which contains its resources.
Though I confirmed that the jar file contains the folder X in BOOT-INF/classes but it tries to find the folder X on its own path - not inside itself.
Does anyone have some idea how can a jar file deployed on PCF can access its resources kept inside itself.
I tried using
InputStream is = this.getClass().getClassLoader().getResourceAsStream("X/abc.xml")
but it didn't work. It is unable to find the path during runtime.
why do not try Apache Abdera.
your XML is obtained from an API.
just another way, btw.
In your main class(usually Application.java) add #ImportResource annotation at class level.
Example: #ImportResource("classpath:myfile.xml")

Java application with simple Web Server exported as JAR

I have created a simple Web Server application using Java APIs.
Web server is working as expected and I am able to get the HTML pages in the browser.
I am developing this Java App on a Windows Machine. For testing I am exporting my app as JAR and then testing it on Target Device which is a Linux Box. In my app I have created a "webroot" folder and I am storing all the HTML files, that web server needs to serve.
So when I create JAR file of the app then it has "webroot" folder with all the html files in it. When I run this application on Windows then I am able to get the html pages. But when I run this application on Linux box as a JAR then I am not able to retrieve html files. Also when I copy my "webroot" folder outside the JAR then it works and I am able to see the HTML pages getting delivered in the browser.
So is there any way I can access html pages which are in the jar file itself without copying them outside?
My Project Folder structure is as below:
/src
-com.myprj.server -> contains server Java files
/webroot -> all the html pages
/bin -> jar files as per the above package path
/myprj.jar -> Project jar file
So above jar file has the webroot folder. And from the code I am accessing it as "webroot/FileName.html". If I keep webroot as in the same folder as jar then it does work.
Without seeing how you're actually serving the content, it's hard to say what you're doing wrong, but you can always use Class.getResourceAsStream() to access the resources from the classpath. If you're running it as a jar file, then the contents of the jar file are included in the classpath too.
To serve content outside of the jar file, either include your "webroot" in the classpath, or create some kind of mechanism to first try the classpath and then an outside path.

Java class and WSDL files cannot connect to each other

At first, I placed the java class file together with the wsdl files inside the WEB-INF folder, they successfully connected. But when I moved the java class file and the wsdl files inside the scr folder because I need to call the java class inside the jsp file, something went wrong. The java class now is full of errors. Seems like they didn't connected. I already configured the wsdl file in web client service. I'm using eclipse as development tools.

Cobertura data file not getting updated

I am trying to find out functional code coverage for my JAVA classes.
My java classes are deployed on a server as a JAR file. (Note: It is not deployed in any application server such as tomcat). After deploying my JAR file to server I instrumented that jar file using ant task. Classes inside my jar file are now instrumented (I confimred that by decompiling the classes). When I run my application (which in turn will access my classes from JAR file) it should created a new data file (.ser file) and add code coverage information into it. But No new data file is getting created neither is old data-file getting updated.
My project structure on server is as follows
Main-Folder
|--cobertura-2.1.1
|--ccbuild.xml
|--cobertura.ser (created during instrumentation)
|--lib
|---code.jar (This file contains my instrumented classes)
|---other-dependency.jar (All other dependencies)
|---cobertura.jar
Why are my class files not generating code coverage information?
I had this problem while generating .ser file. My problem resolved after changing the version of one dependent lib commons-io to V2.4

How to add class Source(src) class folder in Jsp Project Using Eclipse IDE

we have created Jsp Project, in that we had written Java class and use external jar file. Project is running fine in my local tomcat server, while when we deploy it in the main server we don't have access of web apps folder they gave me server access FTP and am sending that my project to that it deploying but only client side code run it show Error when server side code comes
http://www.incometaxindiapr.gov.in/incometaxindiacr/cbdt-cir-not/Home.jsp please check this
class file not compile
i think i am Unable to add class file please help how to add class file an all.
If it runs locally and not able to run while deploying to Server, then first thing what I think you should check is, when you transfer your war to server using FTP at that place only, WAR which is transferred is in correct format,
I mean whether .class files are all transferred and in classes folder only. if all this is correct check versions mismatch. rest can be checked by logs only.

Categories

Resources