- 浏览: 90188 次
最新评论
-
ngn9999:
天下文章一大抄
网页上的FLASH挡住层 -
avi2:
绿色软件直接可以用的
最好的java反编译器 -
无敌小蚂蚁:
http://java.decompiler.free.fr/ ...
最好的java反编译器 -
无敌小蚂蚁:
怎么用?好像不好使!!
最好的java反编译器 -
avi2:
你是不是make少库了?
RSYNC安装使用详解
weblogic with spring hibernate mappingDirectoryLocations error
- 博客分类:
- java
_wls_cls_gen.jar Issue
from http://jaysensharma.wordpress.com/2009/12/28/_wls_cls_gen-jar-issue/
WebLogic 10 And WebLogic 10.3 creates a Jar file (_wls_cls_gen.jar)while deploying our Archieved Applications (WAR files). Which includes all the contains available inside the WEB-INF/classes directory inside this jar file(_wls_cls_gen.jar). I didnot find a way to tell WebLogic Server to not to create this JAR file, because it creates many issues.
Example: if we have placed a Property file or Some XML files inside the “WEB-INF/classes” directory with the name “test.properties” or “test.xml” then WebLogic Server will place this Property file as well inside the (_Wls_cls_gen.jar) file while deployment…
zip:C:/bea103/user_projects/domains/Test_Domain/servers/AdminServer/tmp/_WL_user/testWebApp/8j5e1y/war/WEB-INF/lib/_wl_cls_gen.jar!/test.properties
Now if we write the following code inside out application like Servlet then it won’t work and will fail while reading the Properties file:
Note: Many frameworks uses the Following techinques and Sometimes WebLogic Code causes this issue..(http://forums.oracle.com/forums/thread.jspa?messageID=4217650#4217650)…which may cause our applications to fail while reading jar Archieved resources. because they uses the following techinque to read the resources available inside a JAR file:
——————————————-WRONG – APPROACH – BELOW———————
——————
To avoid the above issue…we need to change our code like following: most of the Frameworks also need to change their implementations…
———————— CORRECT – APPROACH – BELOW ——————-
———————
The above piece of code can be used whenever we want to read a Non-Class/Class resource from inside a JAR file.
Thanks
Jay SenSharma
__________________________________________
weblogic sucks! either you rewrite the function of spring , or you just use the folder way.
besides:
ServletContext.getRealPath returns null
http://ananthkannan.blogspot.com/2009/12/servletcontextgetrealpath-returns-null.html
Another weird behavior from weblogic when webapp is deployed as WAR. ServletContext.getRealPath() returns null when deployed as WAR but it works ok when deployed as exploded. There are two ways we can fix this issue when you still want to deploy as WAR but would like to get over with this issue:
1. Go to server admin console->Domain-> Web applications. Click the checkbox of Archived Real Path Enabled. This should make an entry into domain config.xml as below.
2. Second option is at webapp level by updating weblogic.xml as below:
The value of <show-archived-real-path-enabled> set in the web app has precedence over the value set at the domain level. The default value of this property is false.
have read an article again, maybe I can try
http://forum.springsource.org/showthread.php?t=45204&referrerid=14239
See the Spring Reference 4.7.2.3 http://static.springframework.org/spring/docs/2.5.x/reference/resources.html#resources-wildcards-in-path-other-stuff
which explains why "classpath*:*.hbm.xml" doesn't work. You can get it to work if you put your hbm.xml files in a specified subdirectory/package, for example "classpath*:res/*.hbm.xml". Or if you put them in the same directories as the corresponding Java classes, you could use "classpath*:com/**/*.hbm.xml", assuming your classes are under the root package "com".
Reply With Quote
from http://jaysensharma.wordpress.com/2009/12/28/_wls_cls_gen-jar-issue/
WebLogic 10 And WebLogic 10.3 creates a Jar file (_wls_cls_gen.jar)while deploying our Archieved Applications (WAR files). Which includes all the contains available inside the WEB-INF/classes directory inside this jar file(_wls_cls_gen.jar). I didnot find a way to tell WebLogic Server to not to create this JAR file, because it creates many issues.
Example: if we have placed a Property file or Some XML files inside the “WEB-INF/classes” directory with the name “test.properties” or “test.xml” then WebLogic Server will place this Property file as well inside the (_Wls_cls_gen.jar) file while deployment…
zip:C:/bea103/user_projects/domains/Test_Domain/servers/AdminServer/tmp/_WL_user/testWebApp/8j5e1y/war/WEB-INF/lib/_wl_cls_gen.jar!/test.properties
Now if we write the following code inside out application like Servlet then it won’t work and will fail while reading the Properties file:
Note: Many frameworks uses the Following techinques and Sometimes WebLogic Code causes this issue..(http://forums.oracle.com/forums/thread.jspa?messageID=4217650#4217650)…which may cause our applications to fail while reading jar Archieved resources. because they uses the following techinque to read the resources available inside a JAR file:
——————————————-WRONG – APPROACH – BELOW———————
InputStream stream = null; try { Properties p = new Properties(); String path=Thread.currentThread().getContextClassLoader().getResource(“Info.properties”).getPath(); System.out.println(“—————-PATH: “+path); p.load(new java.io.FileInputStream(path)); Host = p.getProperty(“Host”); Pot = p.getProperty(“Port”); User = p.getProperty(“User”); Passwd = p.getProperty(“Passwd”); System.out.println(“Property Key-Values:” +”\n”+ Host +”\n”+ Pot + “\n”+User+ “\n”+Passwd); } catch (Exception e) { e.printStackTrace(); }
——————
To avoid the above issue…we need to change our code like following: most of the Frameworks also need to change their implementations…
———————— CORRECT – APPROACH – BELOW ——————-
InputStream stream = null; System.out.println(“————————————”); try { Properties p = new Properties(); stream=this.getClass().getClassLoader().getResourceAsStream(“Info.properties”); p.load(stream); Host = p.getProperty(“Host”); Pot = p.getProperty(“Port”); User = p.getProperty(“User”); Passwd = p.getProperty(“Passwd”); System.out.println(“Property Key-Values:” +”\n”+ Host +”\n”+ Pot + “\n”+User+ “\n”+Passwd); } catch (Exception e) { e.printStackTrace(); }
———————
The above piece of code can be used whenever we want to read a Non-Class/Class resource from inside a JAR file.
Thanks
Jay SenSharma
__________________________________________
weblogic sucks! either you rewrite the function of spring , or you just use the folder way.
besides:
ServletContext.getRealPath returns null
http://ananthkannan.blogspot.com/2009/12/servletcontextgetrealpath-returns-null.html
Another weird behavior from weblogic when webapp is deployed as WAR. ServletContext.getRealPath() returns null when deployed as WAR but it works ok when deployed as exploded. There are two ways we can fix this issue when you still want to deploy as WAR but would like to get over with this issue:
1. Go to server admin console->Domain-> Web applications. Click the checkbox of Archived Real Path Enabled. This should make an entry into domain config.xml as below.
<web-app-container> <show-archived-real-path-enabled>true</show-archived-real-path-enabled> </web-app-container>
2. Second option is at webapp level by updating weblogic.xml as below:
<container-descriptor> <show-archived-real-path-enabled>true</show-archived-real-path-enabled> </container-descriptor>
The value of <show-archived-real-path-enabled> set in the web app has precedence over the value set at the domain level. The default value of this property is false.
have read an article again, maybe I can try
http://forum.springsource.org/showthread.php?t=45204&referrerid=14239
See the Spring Reference 4.7.2.3 http://static.springframework.org/spring/docs/2.5.x/reference/resources.html#resources-wildcards-in-path-other-stuff
which explains why "classpath*:*.hbm.xml" doesn't work. You can get it to work if you put your hbm.xml files in a specified subdirectory/package, for example "classpath*:res/*.hbm.xml". Or if you put them in the same directories as the corresponding Java classes, you could use "classpath*:com/**/*.hbm.xml", assuming your classes are under the root package "com".
Reply With Quote
发表评论
-
my idea on test
2012-02-06 23:25 0my idea on test -
12312312312312123123
2010-09-28 10:45 0dddddadfasdfsdfasdf -
JRebel3.0
2010-08-22 11:51 0是用eclipse开发java的时候,经常在修改java类文件 ... -
如何使arraylist 线程安全?
2010-08-09 11:23 1211List list = Collections.synch ... -
poi 控制单元格的string属性
2010-08-05 19:25 1473开发中碰到一个很怪的问题,设置单元格的属性是string了,显 ... -
给类的所有属性赋值
2010-08-03 11:36 1654ContractBo contractBo = new C ... -
Jetty in GWT-DEV Form too large
2010-07-30 14:34 1176java.lang.IllegalStateException ... -
war包中配置文件读取
2010-05-19 13:58 2871尽可能使用 getServletContext().getRe ... -
[转]org.hibernate.hql.ast.HqlToken 错误weblogic异常
2010-05-11 15:57 1383在运行过程中出现 ClassNotFoundException ... -
html转pdf的开源项目
2010-05-08 22:17 1362一个是xhtmlrenderer https://xhtmlr ... -
Unknown Faceted Project Problem in ecipse
2010-05-04 12:58 3573When I imported an existing Ecl ... -
一篇不错的介绍spring security 入门的文章
2010-05-01 22:01 906http://www.blogjava.net/fastzch ... -
Dynamic list binding in Spring MVC
2010-04-27 17:13 1208The Spring MVC documentation ju ... -
hibernate view 映射取空数据的问题
2010-04-13 09:48 807由于视图没有主键,所以hibernate映射联合组件,但是联合 ... -
spring mvc json学习
2010-04-11 21:13 3901首选 http://spring-json.sourcefor ... -
最好的java反编译器
2010-04-11 16:59 1881http://java.decompiler.free.fr ... -
jfreechat 一些杂记
2010-01-25 10:45 1442最近做个项目要用到jFre ... -
[转]java synchronized 的用法
2010-01-24 12:21 1052synchronized 的语法: synchronized ... -
【转帖】JFreechar 乱码
2010-01-22 13:46 859CategoryAxis domainAxis = cat ... -
如何去除JInternalFrame的标题栏
2010-01-18 13:42 3302如何去除JInternalFrame的标题栏 yofly ...
相关推荐
4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics II. Getting Started 8. Introducing Spring Boot 9. System Requirements 9.1. Servlet ...
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
Hibernate和spring中常出现的几个异常 61 71.13. Hibernate与jdbc的联系 62 71.14. Hibernate与Spring的联系 62 71.15. Hibernate自带的分页机制是什么?如果不使用Hibernate自带的分页,则采用什么方式分页? 62 ...
62、error和exception有什么区别 16 63、ArrayList和Vector的区别 16 64、Collection 和 Collections的区别 17 65、Set里的元素是不能重复的,那么用什么方法来区分重复与否呢? 是用==还是equals()? 它们有何区别 17...
【紫光华宇软件工程师笔试题】涉及到的知识点广泛,主要涵盖了Java编程、Spring框架、Hibernate ORM、JDBC、异常处理、设计模式、数据库操作、HTML、CSS、JavaScript以及JSP等多个方面。以下是对这些知识点的详细...
- **Oracle WebLogic Server**:高性能的企业级应用服务器,支持集群、负载均衡等功能。 #### 2. 数据连接池的工作机制 - **连接池**是一种用于存储数据库连接的机制,目的是提高数据库访问效率和减少数据库连接...
14、spring+Hibernate中委托方案怎么配置? 123 15、spring+Hibernate中委托方案怎么配置? 123 16. hibernate进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决; 123 17....
14、spring+Hibernate中委托方案怎么配置? 123 15、spring+Hibernate中委托方案怎么配置? 123 16. hibernate进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决; 123 17....
14、spring+Hibernate中委托方案怎么配置? 123 15、spring+Hibernate中委托方案怎么配置? 123 16. hibernate进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决; 123 17....
14、spring+Hibernate中委托方案怎么配置? 123 15、spring+Hibernate中委托方案怎么配置? 123 16. hibernate进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决; 123 ...
14、spring+Hibernate中委托方案怎么配置? 134 15、spring+Hibernate中委托方案怎么配置? 134 16. hibernate进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决; 135 17....