小编eli*_*rsh的帖子

AOP不可序列化org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl?

我正在使用Eclipse IDE和tomcat 7.0

我有一个客户端 - 服务器应用程序.在服务器端,我有一个实现StationInterface和Serializable的StationInterface和Station类,我也在服务器端使用AOP来记录Station中的一些事件.现在,当我将对象发送到客户端时,我得到了这个异常

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source) …
Run Code Online (Sandbox Code Playgroud)

java aop serialization spring spring-aop

5
推荐指数
0
解决办法
1360
查看次数

无法在applicationContext.xml文件中导入persistence.xml

我正在使用eclipse juno IDE我有Java应用程序,它有src文件夹.在我的文件夹中:

1)applicationContext.xml

2)persistence.xml

我也有DBInterface,我用JPA实现它.现在在applicationContext.xml文件中,我有一个用于JPA实现的bean.

当我尝试注入bean时,我得到了一个类似"找不到持久性提供程序"的删除.

所以我尝试在applicationContext文件中导入持久性文件,但是我得到了另一个例外.

applicationContext.xml中

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:aop="http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
   xmlns:context="http://www.springframework.org/schema/context/spring-context-2.5.xsd"
   xmlns:flow="http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd"
   xmlns:jms="http://www.springframework.org/schema/jms/spring-jms-2.5.xsd"
   xmlns:jee="http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"
   xmlns:lang="http://www.springframework.org/schema/lang/spring-lang-2.5.xsd"
   xmlns:osgi="http://www.springframework.org/schema/osgi/spring-osgi.xsd"
   xmlns:tx="http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
   xmlns:util="http://www.springframework.org/schema/util/spring-util-2.5.xsd"
   xmlns:p="http://www.springframework.org/schema/p"

   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/aop/spring-aop-2.5.xsd/spring-spring-aop-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/context/spring-context-2.5.xsd/spring-spring-context-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd/spring-spring-webflow-config-1.0.xsd-2.5.xsd
      http://www.springframework.org/schema/jms/spring-jms-2.5.xsd http://www.springframework.org/schema/jms/spring-jms-2.5.xsd/spring-spring-jms-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/jee/spring-jee-2.5.xsd/spring-spring-jee-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/lang/spring-lang-2.5.xsd http://www.springframework.org/schema/lang/spring-lang-2.5.xsd/spring-spring-lang-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/osgi/spring-osgi.xsd http://www.springframework.org/schema/osgi/spring-osgi.xsd/spring-spring-osgi.xsd-2.5.xsd
      http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/tx/spring-tx-2.5.xsd/spring-spring-tx-2.5.xsd-2.5.xsd
      http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/util/spring-util-2.5.xsd/spring-spring-util-2.5.xsd-2.5.xsd">


    <bean id="JPA"  class="pack.jpa.JPAQueries"/>
    <import resource="persistence.xml"/>
</beans>
Run Code Online (Sandbox Code Playgroud)

persistence.xml中

<?xml version="1.0" encoding="UTF-8"?>
<persistence xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 

http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> 
         <persistence-unit transaction-type="RESOURCE_LOCAL" name="MyJPA"> 
             <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> 
             <class>pack.bl.Travels</class>
             <class>pack.bl.Example</class> 
             <properties> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/> 
                 <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/taxis"/> 
                 <property name="javax.persistence.jdbc.password" value=""/> 
                 <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/> …
Run Code Online (Sandbox Code Playgroud)

spring persistence jpa javabeans applicationcontext

0
推荐指数
1
解决办法
1万
查看次数