• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Where is _wl_cls_gen.jar coming from?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I notice that after I copy my WAR to the appropriate WL 9.2.2 directory and restart my server, there are no classes in the WL tmp directory -- $WL_HOME/user_projects/domains/nps_pt_92/servers/myserver/tmp/_WL_user/myapp/uy62cb/war/WEB-INF, only a file "_wl_cls_gen.jar" that contains such classes.

Problem is, it contains old classes -- i.e. not the ones in the WAR file's classes directory.

How does this file get generated and is there any way in the admin console I can tell it to not produce that file?

- Dave
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am also facing same problem.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its probably a weblogic generated file. How about redeploying the WAR after deleting it ?

Usually when we have such caching problems with source code we delete the contents of the staging folder and try again (In DEV of course ).

Does that help ? Can you describe your problem a little more elaborately ?
 
Rajiv Dadhich
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Thanks for replying.
The problem is resolved now. Earlier i was storing keystore in /WEB-INF/classes which was not accessible after deploying war on weblogic because of above mentioned problem.
Now, i am reading keystore using getResourceStream(...) and storing its contents in newly created keystore at some temporary location.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks,

I am also facing this problem. Please allow me to describe in bit detail:

I have a webapp deployed on weblogic server 10.3 which uses spring framework. One of java classes which is inside some services.jar accessing a XML file which resides in web-inf/classes folder. That java class loads the XML as below:

final File headerFile = ResourceUtils.getFile("classpath://data-values.xml");

What weblogic does during WAR deployment(obviously it internally explodes) it puts all the files reside in web-inf/classes folder into jar called _wl_cls_gen.jar file and copies into web-inf/lib directory under domain stage folder. This is where the problem during deployment as my java class was unable to read the xml and throwing error as FileNotFoundException.

java.io.FileNotFoundException: class path resource [//data-values.xml] cannot be resolved to absolute file path because it does not reside in the file system: zip:C:/domains/devDomain/servers/AdminServer/tmp/_WL_user/testWebApp/8j5e1y/war/WEB-INF/lib/_wl_cls_gen.jar!/data-values.xml

Is there a way to avoid generating _wl_cls_gen.jar during deployment? or there is a bug in Spring's ResourceUtils.getFile() method?

This works fine when I deploy war as exploded. But my requirement is deploy as WAR only.

Please share your thoughts.

Thanks.
Andy
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check if Spring is the problem by looking into the wl_cls_gen.jar file. Does it have your XML ?

If the XML is missing, it is a problem with weblogic. If you have time to wait, ask the WL support team about the problem and a possible resolution.

If you cannot wait, the easiest thing to do is to remove the file from classes and put it some where else on the class path. Or modify the code to read the file from a standard location that is common to all your environments. For example read from '/usr/data/project/properties.props' on all environments to get around the problem.

I read something about a fast swap method. That might help also. Do you have some sample source code that can be used to replicate the problem ?
 
Andy Kay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Deepak,

Well, I never mentioned XMLs are missing. They are bundled into a _wls_cls_gen.jar from classes folder into web-inf/lib folder. And I can't put my XMLs into a location from where I can read as the application itself is product which is used by few clients. And again fast swap method is supported only in DEV mode. So using the same in PROD is out of question.

Anyways thanks for your help!

Andy
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Well, I never mentioned XMLs are missing



Ah ok. I assumed that WL was discarding it when packaging.

And again fast swap method is supported only in DEV mode. So using the same in PROD is out of question.



Thanks for letting me know that. I have never used fast swap myself but came across it a few days back.

If you find a solution let us know what it is. I will try to replicate the problem if time allows
 
Andy Kay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks,

finally some work around. It looks like there is no way we can stop weblogic NOT to generate _wl_cls_gen.jar file. One way is modify the code, instead of using ResourceUtils.getFile() method, we used ClasspathResource with combination of InputStream. That fixed the issue.

It looks Spring's ResourceUtils.getFile() definitely have a bug in reading XMLs from web-inf/classes folder in WAR deployment.

Hope this helps.

Andy
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for sharing the solution. Out of curiosity, does the getResourceAsStream method help you ?
 
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic